Introduction to new features of CPLibCPLib (2) — Modern C++ Library for Test Data in CP
Difference between en2 and en3, changed 62 character(s)
You can refer to the originalfirst introduction post [here](https://mirror.codeforces.com/blog/entry/124952).↵

During the summer holiday, [user:yzy1,2024-08-06] 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:↵

1. Read and parse the command line arguments.↵
2. Set up the input/output streams and the Reader variable required by the program.↵
3. Set up the reporter.↵

We're maintaining a set of initializers for mainstream platforms. Please refer to [the GitHub repository](https://github.com/rindag-devs/cplib-initializers). To implement a initializer yourself, you only need to inherit few classes and implement their member functions. Visit [the documentary](https://cplib.vercel.app/user-guide/advanced/initializer) 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][arbiter-checker]         | N/A                                                 | N/A                          |                                                                                     |↵
| [CCR-Plus](https://github.com/sxyzccr/CCR-Plus)                             | [ccr][ccr-checker]                 | N/A                                                 | N/A                          |                                                                                     |↵
| [CMS](https://cms-dev.github.io/)                                           | [cms][cms-checker]                 | [cms][cms-interactor]                               | N/A                          | interactor is only available when communication_num_processes=1                     |↵
| [CodeChef](https://www.codechef.com/)                                       | [spoj][spoj-checker]               | [spoj][spoj-interactor]                             | N/A                          |                                                                                     |↵
| [Codeforces Polygon](https://polygon.codeforces.com)                        | [testlib][testlib-checker]         | [testlib-two-step][testlib-interactor-two-step]¹ | [testlib][testlib-validator] | percent_mode=true, enable "Treat points from checker as a percent" in test settings |↵
| [DMOJ](https://dmoj.ca/)                                                    | [coci][coci-checker]               | [coci][coci-interactor]                             | N/A                          | use "bridged" checker or interactor (aka "grader") with type "coci"                 |↵
| [DOMJudge](https://www.domjudge.org/)                                       | [kattis][kattis-checker]           | [kattis][kattis-interactor]                         | N/A                          |                                                                                     |↵
| [HelloJudge](https://yt2soj.top/rs/)                                        | [hello_judge][hello_judge-checker] | N/A                                                 | N/A                          |                                                                                     |↵
| [HustOJ](http://www.hustoj.org/)                                            | [hustoj][hustoj-checker]           | N/A                                                 | N/A                          |                                                                                     |↵
| [Hydro](https://hydro.ac)                                                   | [testlib][testlib-checker]         | [testlib][testlib-interactor]                       | [testlib][testlib-validator] | percent_mode=false²                                                              |↵
| [Lemon (LemonLime)](https://github.com/Project-LemonLime/Project_LemonLime) | [lemon][lemon-checker]             | N/A                                                 | N/A                          |                                                                                     |↵
| [Lyrio (LibreOJ)](https://github.com/lyrio-dev/lyrio)                       | [testlib][testlib-checker]         | [testlib][testlib-interactor]                       | N/A                          | percent_mode=true                                                                   |↵
| [Nowcoder](https://www.nowcoder.com/)                                       | [nowcoder][nowcoder-checker]       | N/A                                                 | N/A                          |                                                                                     |↵
| [QDUOJ](https://qduoj.com/)                                                 | [qduoj][qduoj-checker]             | N/A                                                 | N/A                          |                                                                                     |↵
| [SPOJ](https://www.spoj.com/)                                               | [spoj][spoj-checker]               | [spoj][spoj-interactor]                             | N/A                          |                                                                                     |↵
| [SYZOJ 2](https://github.com/syzoj/syzoj)³                               | [syzoj][syzoj-checker]             | [syzoj][syzoj-interactor]                           | N/A                          |                                                                                     |↵
| [Universal OJ](https://uoj.ac)⁴                                          | [testlib][testlib-checker]         | [testlib][testlib-interactor]                       | [testlib][testlib-validator] | percent_mode=false                                                                  |↵

¹: You need to use [testlib-interactor-two-step] and [testlib-checker-two-step] together. Read [Testlib Two-Step Interaction Help](https://github.com/rindag-devs/cplib-initializers/tree/main/include/testlib/two_step_interaction_help.md) 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.↵

[arbiter-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/arbiter/checker.hpp↵
[ccr-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/ccr/checker.hpp↵
[cms-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/cms/checker.hpp↵
[cms-interactor]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/cms/interactor.hpp↵
[coci-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/coci/checker.hpp↵
[coci-interactor]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/coci/interactor.hpp↵
[hello_judge-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/hello_judge/checker.hpp↵
[hustoj-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/hustoj/checker.hpp↵
[kattis-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/kattis/checker.hpp↵
[kattis-interactor]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/kattis/interactor.hpp↵
[lemon-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/lemon/checker.hpp↵
[nowcoder-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/nowcoder/checker.hpp↵
[qduoj-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/qduoj/checker.hpp↵
[spoj-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/spoj/checker.hpp↵
[spoj-interactor]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/spoj/interactor.hpp↵
[syzoj-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/syzoj/checker.hpp↵
[syzoj-interactor]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/syzoj/interactor.hpp↵
[testlib-checker]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/testlib/checker.hpp↵
[testlib-checker-two-step]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/testlib/checker_two_step.cpp↵
[testlib-interactor]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/testlib/interactor.hpp↵
[testlib-interactor-two-step]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/testlib/interactor_two_step.hpp↵
[testlib-validator]: https://github.com/rindag-devs/cplib-initializers/tree/main/include/testlib/validator.hpp↵

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](https://github.com/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](https://cplib-wasm-demo.vercel.app/). You can also check the source code in [yzy-1/cplib-wasm-demo](https://github.com/yzy-1/cplib-wasm-demo).↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English tiger2005 2024-08-06 08:08:15 62 Tiny change: 'er to the original introduct' -> 'er to the first introduct'
en2 English tiger2005 2024-08-06 07:28:53 0 (published)
en1 English tiger2005 2024-08-06 05:54:40 10659 Initial revision (saved to drafts)