Repository navigation
build: write the variants of each x87 fixture in one Python process - #1789
Merged
Merged
Conversation
This was referenced Nov 24, 2026
tedin7
marked this pull request as ready for review
November 24, 2026 18:54
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
This was referenced Nov 24, 2026
Each of the 21 x87 fixture groups started one Python process per variant (166 in all) and every process loaded the interpreter, the PE reader and the lifter again. tools/emit_variants.py now writes all variants of one fixture from one process, through the same emit() the script runs from its command line. Output paths, dependencies and target names are unchanged; x2w_emit_variants() creates one command with every variant file as OUTPUT. tests/emit_variants_check.py checks the driver against one process per variant.
tedin7
force-pushed
the
x2w-cmake-batch-py
branch
from
November 24, 2026 21:55
6a17297 to
0bf9c54
Compare
This was referenced Nov 24, 2026
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.
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.