Welcome to WAJ!

Welcome to the WASM Judge test dataset submission portal. Please read the following guidelines carefully before submitting your code.

Brief Introduction to the Principles

The principles behind the WASM Judge system are designed to ensure efficient and accurate evaluation of WebAssembly (WASM) submissions. The system leverages a combination of advanced algorithms and performance metrics to assess the correctness and efficiency of the code. For a more detailed explanation, please refer to the following link: Principles Overview (中文).

User Feedback

We value your feedback and suggestions to improve our platform. Please join our QQ group 1023748105 for discussions and support.

Access Requirements

Submission Constraints

Licensing Agreement

To avoid copyright issues with the test dataset, your submitted code will be considered as your agreement to license it under the 0BSD (BSD Zero Clause License). Therefore, you MUST ensure that the code you submit is either your own original work or that you have obtained explicit permission from the original author.

Compilation Parameters

Compilation will use wasi-sdk-25 (available at wasi-sdk-25 release).

C 17 (Clang)

For native evaluation:

/usr/bin/clang-19 -xc foo.code -o foo -std=c17 -O3 -DONLINE_JUDGE=waj -ferror-limit=3

For WASM evaluation:

/usr/bin/clang-19 -xc foo.code -o foo -std=c17 -O3 --sysroot=/opt/wasi-sysroot -DONLINE_JUDGE=waj -ferror-limit=3 --target=wasm32-wasi-wasip1 -mcpu=mvp -mno-bulk-memory -msign-ext -mno-tail-call

C++ 17 (Clang)

For native evaluation:

/usr/bin/clang++-19 -xc++ foo.code -o foo -std=c++17 -O3 -DONLINE_JUDGE=waj -ferror-limit=3 -stdlib=libc++

For WASM evaluation:

/usr/bin/clang++-19 -xc++ foo.code -o foo -std=c++17 -O3 --sysroot=/opt/wasi-sysroot -DONLINE_JUDGE=waj -ferror-limit=3 --target=wasm32-wasi-wasip1 -fno-exceptions -mcpu=mvp -mno-bulk-memory -msign-ext -mno-tail-call

C++ 23 (Clang, unstable)

For native evaluation:

/usr/bin/clang++-19 -xc++ foo.code -o foo -std=c++23 -O3 -DONLINE_JUDGE=waj -ferror-limit=3 -stdlib=libc++

For WASM evaluation:

/usr/bin/clang++-19 -xc++ foo.code -o foo -std=c++23 -O3 --sysroot=/opt/wasi-sysroot -DONLINE_JUDGE=waj -ferror-limit=3 --target=wasm32-wasi-wasip1 -fno-exceptions -mcpu=mvp -mno-bulk-memory -msign-ext -mno-tail-call

FAQ

Why is there a significant difference in memory usage between native and WASM evaluations?

Native evaluation calculates the used space, while WASM calculates the allocated space. In certain scenarios, such as declaring large static arrays but only utilizing a small portion, there may be discrepancies between the two calculation methods.

Compilation Error: "clang frontend command failed due to signal"

This error typically occurs when the program contains large static arrays of structures or classes. It originates from a bug in clang (GitHub Issue), and it only occurs when using C++20 or higher standards. You can avoid this issue by selecting a lower C++ standard.

Code Restrictions

Your code MUST NOT include:

Conclusion

By submitting your code, you agree to adhere to these guidelines. Failure to comply with any of the above requirements may result in disqualification from the dataset.

This document uses the terminology defined in RFC 2119.