Repository navigation
fix(codegen): say why a sampled spec does not compile, and count a compiler that cannot run apart - #873
fix(codegen): say why a sampled spec does not compile, and count a compiler that cannot run apart#873gHashTag wants to merge 1 commit into
Conversation
…mpiler that cannot run apart zigTestOk threw the child's output away on both failure paths: a spawn error came back as "does not compile", and a nonzero exit freed stderr unprinted. The phi_utils_multi failure on main (run 37225448222) could not be diagnosed from its log for that reason. A failure now prints the last 40 lines of zig's stderr under the DOES NOT COMPILE line. A spawn error is reported as COULD NOT RUN with its error name and counted separately; it still fails the job, as CompileSampleNotRun rather than CodegenCorpusRegressed. Tests: lastLines, a planted type error (does_not_compile, and the log shows the compiler's error line), a clean file (compiled), and a missing compiler (could_not_run, FileNotFound). Closes #871 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
X Brain Health CheckScore: 100.0/100 X Brain is above merge threshold |
🧪 Brain Stress Test ResultsScore: not measured (no stress test prints a Score: line) X Stress test passed |
|
#873 and #886 conflict with each other in How it was found: a trial merge of the 20 open loop PRs onto main 57de4a1, in the proposed order, done in git's object store only ( A tested resolution is on
Verified:
Not verified: no COULD NOT RUN or DOES NOT COMPILE line fired in that run, so the merged failure messages have run only in the unit tests, not in CI. When the first of the two merges, the second can take 3d94723's 🤖 Generated with Claude Code |
…baseline sample #873's d02f21e replayed onto #886 (fix/codegen-corpus-sample b937408). The two PRs edit the same three places in tools/codegen_corpus.zig; this is the resolved tree, so whichever merges second has a tested resolution. Resolution: - sample and stride come from #886 (the committed baseline), and could_not_run from #873 is declared next to them; - the failure message keeps #873's four counts, with #886's denominator: picked.items.len, the slots that were still clean and were compiled; - the COULD NOT RUN message uses picked.items.len as its denominator too (#873 used sample, which counts slots dropped as regressed). Local, Zig 0.16.0 with the shim modules from main: zig test 7/7 (both PRs' tests, including the positive and negative controls), zig build-exe links, zig fmt --check clean. Refs #871, #885, #851. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d02f21e to
5dde66e
Compare
Summary by t27-beesThis PR splits the "does not compile" outcome into two cases: a real compile failure (nonzero exit) now prints the last 40 lines of stderr so the cause is visible, while a compiler that cannot be spawned or whose output overflows the 512 KiB cap is reported and counted separately as "COULD NOT RUN". A new Worth a look
Read: 1 files, +105 -12, the whole diff. Head |
What
On main,
zigTestOkintools/codegen_corpus.zigdrops the reason on both of its failure paths:catch return falsereports a spawn error as "does not compile". So does stderr overflowing the 512 KiB cap.r.stderrwithout printing it.Because of this, the
phi_utils_multifailure on main (run 37225448222) cannot be diagnosed from its log. Issue #871 has the details.This PR:
zig testexits nonzero or is killedDOES NOT COMPILE: <spec>, and nothing else|zig testcannot be started, or its output overflowsDOES NOT COMPILE: <spec>COULD NOT RUN zig test: <spec> (<ErrorName>), counted separatelyCompileSampleNotRunrather thanCodegenCorpusRegressed, because the compile check did not happenThe ast-check pass and the sample selection are not touched.
Measured
These are local runs on Zig 0.16.0, with the shim modules taken from main (
src/tri/tri_proc.zig,tri_io.zig,tri_env.zig) and passed as-Mmodules:DOES NOT COMPILEline. That comes from reading lines 287 and 290–293; I did not run main's tool to confirm it.zig build-exeof the tool links cleanly.zig fmt --checkis clean.Not measured
This PR's own CI run.
codegen.ymlrunszig build codegen-corpuson every PR to main, so it exercises the normal path end to end. Results follow in the checks.Why
phi_utils_multifailed in run 37225448222. That becomes readable the next time the failure recurs, not before.The new tests do not run in CI. They are not wired to any build step. The tool imports named modules, so a step would need the same
-Mwiring thatastcheck_ratchethas inbuild.zig. That is a separate change, left out to keep this diff to one file. To run them by hand:Closes #871. Refs #851.
🤖 Generated with Claude Code