diff --git a/stage0/CLAUDE.md b/stage0/CLAUDE.md index c07d8f6d03..48183a8c2c 100644 --- a/stage0/CLAUDE.md +++ b/stage0/CLAUDE.md @@ -1,7 +1,9 @@ # Sema porting instructions -Goal: make `stages_test.zig` skip over fewer corpus tests. Continue until all -corpus tests pass. +Goal: honestly port Sema from Zig to C. One way to measure progress is +`stages_test.zig` skipping over fewer corpus tests. Continue until all corpus +tests pass. We want _an honest, mechanical implementation_ and no test-specific +hacks, never. ## Key files @@ -50,11 +52,10 @@ engineer the output and recreate it directly. ### No workarounds — always port When a test fails, the only correct response is to port the upstream -implementation that makes it pass. Never work around a failure by -rearranging tests, skipping tests, adjusting test ordering, adding -special-case hacks, or any other technique that increases `num_passing` -without fixing the underlying missing functionality. Every `num_passing` -increment must represent genuinely ported upstream behavior. +implementation that makes it pass. Never work around a failure by adding +special-case hacks, or any other technique that increases `num_passing` without +fixing the underlying missing functionality. Every `num_passing` increment must +represent genuinely ported upstream behavior. ### When you see a gap @@ -158,11 +159,14 @@ Go back and fix it — never commit with fewer passing tests than before. ./zig-out/bin/zig build-obj stage0/sema_tests/return_integer.zig \ --verbose-intern-pool -target wasm32-wasi -OReleaseSmall -fno-emit-bin ``` -- The C sema (zig0) also supports `--verbose-intern-pool`. Build and - run: + +- The C sema (zig0) also supports `--verbose-intern-pool` and `--verbose-air`. + Build and run: + ``` zig build zig0 ./zig-out/bin/zig0 --verbose-intern-pool some_file.zig + ./zig-out/bin/zig0 --verbose-air some_file.zig ``` Use `--module-root DIR` to set the repo root for standalone files: ```