Repository navigation
The migrator rules M*LIB's upstream B+tree test exposed; the gate runs c-migrator-basic-tests - #2576
Merged
Merged
Conversation
added 4 commits
October 23, 2026 03:10
…ungetc, strcoll, strspn, strcspn, strpbrk, strncat M*LIB's upstream B+tree test (tests/test-mbptree.c with m-string.h and tests/test-obj.h, the Phase 4 gate) parses through `fscanf`/`ungetc` and scans with `strpbrk`/`strspn`/`strcspn`/`strcoll`; the migrator refused each as an "unsupported filtered system variable". All seven are C standard: std.libc declares them, the migrator's libc allowlist and its ownership observer list admit them (none retains a pointer it is handed), and libc-surface-check's standard list names them.
`default: int d1 = c - '0'; int d2 = ...; return d2 + 1;` (m-string.h's octal escape parser) bailed at the DeclStmt: a switch arm's statements were lowered one by one with the switch's scope, and only a compound block threaded declarations through `lower_decl_stmt_structural`. An arm's statement now lowers through `lower_arm_stmt_ir`: a declaration is the arm's local, scoped to the arm as a block's is to the block, and the arm's scope threads through its later statements. Fixture: switch_arm_decl.
…ts the C pointer a variadic literal is CLAUDE.md names c-migrator-basic-tests in the gate's fixed list; build.w's list did not have it, so the target ran only under the release tier's c-migrator-tests and a red landed on main unseen: #2556's rule renders a string literal in a variadic position as C's `const char*` (`c"…".ptr`), and the #791 fixture still expected a With `str` there. The rule is right: a `str` in a variadic C slot is read as two words (`fprintf(..., "%s|%d", "compress", 7)` prints `compress|8`, the str's length; filed as #2574 for the compiler). The fixture expects the pointer, and the gate runs the target.
M*LIB's M_IF selects a function by a literal condition (`(1 ? m_string_cat_printf : m_string_printf)(s, "%s", x)`); lowered as a conditional over two function values it was refused, since a `...` function is called directly, never used as a value. A conditional callee whose condition is an integer literal, or that literal compared with zero, folds to its arm before the call is built. Fixture: ternary_callee. A runtime condition (`(append ? m_string_cat_cstr : m_string_set_cstr)(s, "[")`) lowers as one call per arm under the condition, the arguments lowered once and shared (one arm runs, as in C); the then-arm's declaration coerces them, since C requires the arms' types to agree.
Contributor
Author
|
Battery GREEN on 202cbc7 (seed nightly-20261020-local-3, 389 s wall; logs out/battery/ in the worktree). Gate green, c-migrator-basic-tests included. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The migrator rules M*LIB's upstream B+tree test exposed (task:
tests/test-mbptree.cunder With, the Phase 4 gate), each general with a fixture, and the gate drift that let a basic-tests red land.fscanf,ungetc,strcoll,strspn,strcspn,strpbrk,strncat); the migrator's libc allowlist and ownership observer list admit them;libc-surface-check's standard list names them.switch_arm_decl.(1 ? f : g)(x), M*LIB'sM_IF) folds to its arm; a runtime condition lowers as one call per arm under the condition, the arguments lowered once and shared and coerced by the then-arm's declaration. Fixtureternary_callee.c-migrator-basic-tests(CLAUDE.md named it in the fixed list; build.w did not have it, so the target ran only at release tier). The red it hid: STC corpus (std.stc) and its test lanes: stdlib_sourcing_plan Phase 3, the pipeline half #2556's rule renders a string literal in a variadic position as C'sconst char*, and the CI: run the full green battery (build :test) on linux presubmit #791 fixturemacro_body_string_literalstill expected a Withstrthere. The rule is right (astrin a variadic C slot is read as two words; Astrpassed in a variadic C position is read as two words #2574 filed for the compiler), so the fixture expects the pointer.With these, the whole-program migration of
tests/test-mbptree.c(M_USE_STDIO=1, as upstream's test-obj.h needs) checks clean except for #2575: a program alias named like a lazily-skipped std alias forces the std alias to resolve in the program's context ("unknown type" insidestd.engines.mlib.defs), which blocks the test lane itself and shows a stage1/stage2 divergence. The lane follows once #2575 is fixed.