build: write the variants of each x87 fixture in one Python process #1782
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1789"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T18:43:05Z.
Writes the variants of each x87 fixture from one Python process instead of one process per variant. No generated file, dependency, target or CTest name changes.
What changed
tools/emit_variants.py(new):emit_variants.py <script> <image> <variant>=<output>...loads the fixture script as a module and calls its ownemit(image, output, control)for each variant, in order. The interpreter, the PE reader and the lifter modules load once per fixture. Accepts one or more<variant>=<output>pairs and rejects missing or malformed pairs.CMakeLists.txt: a helperx2w_emit_variants()makes one custom command per fixture with every variant file asOUTPUT(same path as before:<image>_<variant>.cppin the build directory) and the sameDEPENDS(plus the new driver). The 21foreach(variant ...)groups fortests/cpu/x87_*.pycall it; theiradd_librarylines and the CTest names are untouched.tests/emit_variants_check.py+ CTestemit_variants: a synthetic fixture script; the driver must write the same bytes as one process per variant (both multi-variant and single-variant), fail when a variant fails, and refuse malformed or missing pairs.Verification on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + Ninja + MASM)
At commit
6a1729779bc00454b97cd32ceb22e4796c90acce(buildingcpu_x87_harnessplus 4 x87 fixture groups —cpu_x87_add,cpu_x87_mul,cpu_x87_fnstcw,cpu_x87_bcd— 4 batched Python steps instead of 29, 29 generated DLLs):--preset dev):cmake --build --preset dev --target cpu_x87_harness cpu_x87_{add,mul,fnstcw,bcd}* -- -j 8):4.98s(configure1.84s)ctest --preset dev -R '^(emit_variants|cpu_aot_x87_add|cpu_aot_x87_mul|cpu_aot_x87_fnstcw|cpu_aot_x87_bcd)$' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (3.93s:emit_variants0.96s,cpu_aot_x87_fnstcw1.18s,cpu_aot_x87_add2.07s,cpu_aot_x87_mul3.63s,cpu_aot_x87_bcd3.82s)/O2(--preset release):cmake --build --preset release --target cpu_x87_harness cpu_x87_{add,mul,fnstcw,bcd}* -- -j 8):2.01s(configure1.76s)ctest --preset release -R '^(emit_variants|cpu_aot_x87_add|cpu_aot_x87_mul|cpu_aot_x87_fnstcw|cpu_aot_x87_bcd)$' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (4.02s:emit_variants0.95s,cpu_aot_x87_fnstcw1.17s,cpu_aot_x87_add2.20s,cpu_aot_x87_mul3.61s,cpu_aot_x87_bcd3.92s)sccache: 58/58 hits (100.00%, confirming identical generated C++ outputs); total wall25.12s.tools/emit_variants.pyto always pass"lifted"instead ofvariantcausedctest -R '^emit_variants$'to fail (AssertionError: pc64: batch wrote b'image.dll:lifted:True', one process per variant wrote b'image.dll:pc64:True',0.30s).Linux byte-for-byte & hygiene checks
.cppfiles matched byte-for-byte (diff -rq) against one process per variant.git diff --check,tests/emit_variants_check.py,tests/docs_links_check.py,tests/bidi_controls_check.py: pass.git merge-treeagainstorigin/main,#1173,#1740,#1752: 0 conflicts.Scope note
emit <image> <out> <variant>groups (rcx_branches,string_ops,trap, ...) are not changed here; they can use the same helper in a follow-up.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T18:54:42Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
6a17297ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.