commit 8a809099b072a22b74c1e95db61d2201e4e70bfb (tree)
parent 3d5ac825cdcdb174e2a55f546eb8bd8a7765e564
Author: Motiejus <motiejus@jakstys.lt>
Date: Sat, 7 Mar 2026 22:51:03 +0200
update CLAUDE.md
Diffstat:
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git 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:
```