You can refer to the original introduction post here.
During the summer holiday, yzy1 has implemented several features for CPLib, the majority of which are designed to improve the compatibility with well-known testing systems.
CPLib Initializers
If you need to use CPLib on an evaluation platform that does not natively support it, the best way to use it is to implement a custom initializer. The initializer needs to do three things:
- Read and parse the command line arguments.
- Set up the input/output streams and the Reader variable required by the program.
- Set up the reporter.
We're maintaining a set of initializers for mainstream platforms. Please refer to the GitHub repository. To implement a initializer yourself, you only need to inherit few classes and implement their member functions. Visit the documentary for detailed information.
Below are platforms that we have checked the compatibility and implemented the initializers.
Platform | Checker | Interactor | Validator | Note |
---|---|---|---|---|
Arbiter (on NOI Linux 2.0) | arbiter | N/A | N/A | |
CCR-Plus | ccr | N/A | N/A | |
CMS | cms | cms | N/A | interactor is only available when communication_num_processes=1 |
CodeChef | spoj | spoj | N/A | |
Codeforces Polygon | testlib | testlib-two-step¹ | testlib | percent_mode=true, enable "Treat points from checker as a percent" in test settings |
DMOJ | coci | coci | N/A | use "bridged" checker or interactor (aka "grader") with type "coci" |
DOMJudge | kattis | kattis | N/A | |
HelloJudge | hello_judge | N/A | N/A | |
HustOJ | hustoj | N/A | N/A | |
Hydro | testlib | testlib | testlib | percent_mode=false² |
Lemon (LemonLime) | lemon | N/A | N/A | |
Lyrio (LibreOJ) | testlib | testlib | N/A | percent_mode=true |
Nowcoder | nowcoder | N/A | N/A | |
QDUOJ | qduoj | N/A | N/A | |
SPOJ | spoj | spoj | N/A | |
SYZOJ 2³ | syzoj | syzoj | N/A | |
Universal OJ⁴ | testlib | testlib | testlib | percent_mode=false |
¹: You need to use testlib-interactor-two-step and testlib-checker-two-step together. Read Testlib Two-Step Interaction Help for details.
²: Hydro accepts both 1 and 100 points as full score: When the score is <= 1, 1 is considered full score, otherwise 100 is considered full score. However, to prevent parsing errors caused by scoring less than 1 out of 100, it is recommended to set full score to 1.
³: SYZOJ 2 and Lyrio are two different platforms, and LibreOJ is no longer developed based on SYZOJ 2.
⁴: UOJ Community Edition needs to edit the source code or upgrade the compiler to get C++ 17 or higher support.
By the way, the only popular testing system that is incompatible with CPLib is Luogu, as Luogu checkers and interactors are forced to compile with C++ 14, which is lower than the C++ 17 required by CPLib.
WASM Support
With the help of WebAssembly/wasi-sdk, CPLib codes can be compiled into WASM files, which can be distributed and processed through browsers. With these WASM files, it's possible for testing systems to draw graphs based on JSON-formatted input, simulate interactive process online, automatically identify multiple test cases and so on.
You can experience some of these features on CPLib WASM Demo. You can also check the source code in yzy-1/cplib-wasm-demo.