zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 8e876c92a8def88c4085db6ecc7b80f28237d1c2 (tree)
parent d0d84bf6ee389b74e4ea3c6da36a1c2bbef39fa1
Author: Motiejus <motiejus@jakstys.lt>
Date:   Sun,  1 Mar 2026 17:28:25 +0000

stage0: update CLAUDE.md with IP gap closure status

Document the current state: first 10 entries aligned, divergence at
memoized_call. List next steps for closing the remaining 62-entry gap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Diffstat:
Mstage0/CLAUDE.md | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/stage0/CLAUDE.md b/stage0/CLAUDE.md @@ -157,4 +157,29 @@ Go back and fix it — never commit with fewer passing tests than before. zig build zig0 ./zig-out/bin/zig0 --verbose-intern-pool some_file.zig ``` + Use `--module-root DIR` to set the repo root for standalone files: + ``` + ./zig-out/bin/zig0 --module-root . --verbose-intern-pool stage0/sema_tests/return_integer.zig + ``` Compare C sema IP entries against the Zig compiler's dump above. + +## Current status (2026-03-01) + +**num_passing = 5.** Tests 0-4 pass (empty, const_decl, empty_void_function, +type_identity_fn, reify_int). + +**Next blocker: return_integer.zig** (index 5). `export fn f() u32 { return 42; }` +interns 42:u32 at an IP index that depends on the module-level entry count. +Zig compiler has `func_ip=217`, C sema creates 157 entries (gap = 62). + +**IP alignment progress:** entries $124-$133 now match (module loading order +fixed). Divergence starts at $134: Zig creates `memoized_call` (from +`debug.assert(...)` in std.zig's comptime block), C sema creates different +entries (ptr_uav, undef, ptr_comptime_alloc). + +**Next steps to close the gap:** +1. Port `memoized_call` IP entry creation for comptime function calls + (replaces the 5 spurious entries at C sema [134]-[138]). +2. After memoized_call, align the builtin module chain ($135-$141). +3. Port CallingConvention enum resolution ($142-$166, ~25 entries). +4. Align remaining entries ($167-$216, ~50 entries).