You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci: build the startup stand-ins and run their checks in CI #1149
Run ctest -R '^startup_stubs$' in the Windows job; it needs no GPU and no game files.
Run a Python syntax/lint pass over tools/startup/.
Make pe_package_import_closure skip (77) when the symlink privilege is missing (WinError 1314) instead of failing.
Add labels for startup areas (startup-runtime, shader-translation, directstorage, xg-layout) so these issues can be filtered.
Keep a small corpus of source-built gfx1013 fixtures for every translator feature added for startup (SDWA, 3D images, inline samplers), so
translator changes are checked without executables.
Done when
The CI job runs the checks above on every pull request.
Context: docs/startup-runtime.md (#1135). Do not attach game files, dumps or logs that contain addresses or names from an executable; describe results in terms of the component tested.
The two Windows jobs on #1135 first found startup_stubs but could not run it on a fresh configure because the Python path was empty at registration. The branch now registers the test after initializing the path and uses the existing Python availability check. A fresh Release configure with the default Python path passed locally on 5691fe8. Both Windows workflows already run the relevant CTests, so please check the new job logs before adding a separate CI command. #1126 handles the symlink case separately. A targeted Python check or a new translator fixture can be reviewed independently if it fills a gap.
Verified on the merged #1135 head da5884a. Both hosted Windows jobs executed startup_stubs and passed it: Debug and /O2. The full main and manual workflows remain the place to check this test under the fast PR policy. For follow-ups, please identify a specific untested launcher or translator behavior and the source-built control that would cover it.
Following R0Y00's note above: two gfx2hlsl.py behaviours that are translated today but have no source-built check. I'll take both, as one small PR each, in the style of tests/startup_sampler_heap_check.py. Each has gfx1013 assembly plus recorded words, an llvm-mc reassembly mode for the gfx1013 job, and a desktop draw.
3D image sampling (dim:SQ_RSRC_IMG_3D → Texture3D<float4> with a float3 coordinate). A 2×2×2 texture has different values in its two depth slices. The draw samples each slice and reads back the values on a GTX 1060 and in-box WARP, with DXC ps_6_0 and FXC ps_5_1. Control: the translated shader with the z coordinate fixed to the other slice must fail.
Inline samplers built with s_bfm_b32 (constant-folded sampler words → smp manifest line). This checks that the folded words equal the masks the assembly builds, and that a non-constant operand stays a run-time expression and isn't folded. The draw check of the decoded sampler waits for gpu: bind translated startup sampler heaps #1237, which moves the stand-in's sampler decoder into a shared header.
Taking the remaining "checks over tools/startup/" slice as a specific untested launcher behavior, per the note above: tools/startup/launch.py has no source-built control for what it claims to guarantee (kill-on-close job, timeout, commit cap, captured stdout/stderr/trap log). I will not touch gfx2hlsl.py or debug_launch.py.
Plan: a small source-built fixture EXE plus a Python check registered as a ctest, so the Windows jobs run it without a separate CI command. Cases, each with its control:
a fixture that exits 7, writes known bytes to stdout/stderr and to X2W_TRAP_LOG: the launcher reports exit code 0x00000007 and the three captured files hold those bytes;
the same fixture in sleep mode with --timeout 1: the launcher reports the timeout, terminates the job (0xdead0001) and returns within the timeout;
a commit-cap case (the fixture asks for more than --memory-gib allows and the allocation fails, then succeeds under a larger cap);
the missing-EXE error path (CreateProcess failed, launcher exit code 2);
if the job enforces it, --max-processes blocking a grandchild, with the larger limit as the control.
Verification is the ctest run itself plus the pre-fix control: each assertion names the launcher line it reads, and case 4 fails today only because no check reads it. I will report the measured output.
Opened #1261 for the launcher-check slice: a source-built probe plus a ctest that reads back what tools/startup/launch.py claims to guarantee.
tests/startup_launch_probe.cpp writes known bytes to stdout/stderr/X2W_TRAP_LOG, reports a known exit code, or asks for more memory, spawns a helper or stays alive.
tests/startup_launch_check.py (ctest startup_launch) checks the exit-code report, the three captured files, the --timeout kill, --memory-gib and --max-processes (each with the larger limit as the control) and the missing-EXE path.
The pr preset builds the probe and runs the test, so the Windows jobs run it on pull requests; main-branch runs pick it up with the rest of the suite. docs/startup-runtime.md has the command.
Local measured output on a release configuration: 1/1 Test #217: startup_launch ... Passed 1.76 sec, with allocate failed error=1455 vs allocate ok 1024 MiB and spawn failed error=1816 vs spawn ok for the controls. Removing either job limit flag or the trap-log environment from launch.py makes the check fail with a specific assertion, so the cases are not vacuous.
This does not touch gfx2hlsl.py, debug_launch.py or the stand-in device source. I have not added the general Python syntax pass over tools/startup/; I can do that as a second small PR if you would rather have it separate.
Taking one more untested tool under this issue, per the note above: tools/startup/capture.py, the reader for capture.bin (no test covers it today). I will not touch the launcher check (#1261), gfx2hlsl.py or debug_launch.py.
Plan: tests/startup_capture_check.py registered as ctest startup_capture, with a synthetic capture.bin built byte for byte from the record layouts in src/startup_stubs/d3d12_capture.inl (FRAM, CALL, MEM, PSO, ROOT, RES, HEAP, OBJ, VIEW, TABL, TGTS, PRES):
every record kind decodes to the values written, including both D3D12_RESOURCE_DESC blocks of RES;
Memory.read returns the bytes captured last at or before a call sequence, and a different one for an earlier sequence;
truncated and corrupted streams fail cleanly instead of being half-read.
#1261 is now on main. The Windows PR smoke job built the source-only probe and ran startup_launch in 1.45 s. It exercised exit-code and stream capture, timeout, commit and child-process limits with their permissive controls, and a missing executable. The broader startup-stand-in CI checklist above is still open.
Taking one more untested stand-in behavior under this issue: the DirectStorage stand-in's zlib decoder, src/startup_stubs/inflate.h. The existing stub-consumer fixtures only reach stored blocks, a fixed block that repeats one byte at distance 1, and single-byte runs. With the last distance code's extra bits changed from 13 to 12 and the match-distance check removed, startup_stubs and startup_storage_directory_batch still pass. I will not touch xcrdapi.cpp, the BCPack decoder (#1390), debug_launch.py or run.ps1.
Plan: a source-built probe that runs inflate_zlib on one stream into a destination with guard bytes on both sides, plus tests/startup_inflate_check.py (ctest startup_inflate):
streams that CPython's zlib encodes from seeded synthetic data (stored, fixed and dynamic blocks, a sparse alphabet that needs the code-length repeat codes, matches up to the 32 KiB window, a sync flush) must decode to the input;
controls that must be rejected without writes outside the destination: one byte too little capacity, a truncated stream, and a hand-built match that starts before the output (the same block with distance 1 decodes).
Three more untested stand-in behaviors, one PR each. Each one is a device-free C++ check of a single src/startup_stubs header, found by single-point mutation against the existing CPU and WARP tests. None of the three changes the header or the device code.
startup: check that the last derived blend patch wins #1447derived_blend.h (slot 55 blend-patch scan). The startup_stream_draw tests do not see the returned descriptor offset, the whole-record check or the null check. Three of nine mutants survived those tests.
startup: check the logical view table bounds #1450logical_view_table.h (root table windows and records). startup_logical_view_* skips (77) on WARP and on an RX 6600, and the other draws bind a one-record table at offset 0. Six of six mutants survived.
textures: check the BC7 4 KiB standard detile order #1452bc7_4k_s.h (BC7 4 KiB standard sizes, block order and detile). The existing checks use only square tile grids and accepted descriptions. The tile_rows-for-tile_columns tile index, a dropped MipLevels condition and a dropped Alignment condition all survived.
Each PR has its mutation table and the exact commands. Their CMake blocks are separated, so they merge in any order. I am not touching the other slices claimed here.
More untested stand-in behaviors, one PR each. Each was found by single-point mutation against the existing CPU and WARP tests. Every PR has its mutation table and exact commands, changes only tests, CMake and docs, and merges in any order with the others.
startup: check the translated sampler bindings #1480translated_sampler_bindings.h: sampler word decoding per axis, filters, anisotropy and border, smpheap lines, snapshot counts and equality. 14 of 16 mutants survived.
Activity
R0Y00 commentedon Nov 24, 2026
The two Windows jobs on #1135 first found startup_stubs but could not run it on a fresh configure because the Python path was empty at registration. The branch now registers the test after initializing the path and uses the existing Python availability check. A fresh Release configure with the default Python path passed locally on 5691fe8. Both Windows workflows already run the relevant CTests, so please check the new job logs before adding a separate CI command. #1126 handles the symlink case separately. A targeted Python check or a new translator fixture can be reviewed independently if it fills a gap.
R0Y00 commentedon Nov 24, 2026
Verified on the merged #1135 head da5884a. Both hosted Windows jobs executed startup_stubs and passed it: Debug and /O2. The full main and manual workflows remain the place to check this test under the fast PR policy. For follow-ups, please identify a specific untested launcher or translator behavior and the source-built control that would cover it.
Jess-Doit commentedon Nov 24, 2026
Following R0Y00's note above: two
gfx2hlsl.pybehaviours that are translated today but have no source-built check. I'll take both, as one small PR each, in the style oftests/startup_sampler_heap_check.py. Each has gfx1013 assembly plus recorded words, anllvm-mcreassembly mode for the gfx1013 job, and a desktop draw.dim:SQ_RSRC_IMG_3D→Texture3D<float4>with afloat3coordinate). A 2×2×2 texture has different values in its two depth slices. The draw samples each slice and reads back the values on a GTX 1060 and in-box WARP, with DXCps_6_0and FXCps_5_1. Control: the translated shader with the z coordinate fixed to the other slice must fail.s_bfm_b32(constant-folded sampler words →smpmanifest line). This checks that the folded words equal the masks the assembly builds, and that a non-constant operand stays a run-time expression and isn't folded. The draw check of the decoded sampler waits for gpu: bind translated startup sampler heaps #1237, which moves the stand-in's sampler decoder into a shared header.AI-assisted (Claude Code).
triggered02 commentedon Nov 24, 2026
Taking the remaining "checks over
tools/startup/" slice as a specific untested launcher behavior, per the note above:tools/startup/launch.pyhas no source-built control for what it claims to guarantee (kill-on-close job, timeout, commit cap, captured stdout/stderr/trap log). I will not touchgfx2hlsl.pyordebug_launch.py.Plan: a small source-built fixture EXE plus a Python check registered as a ctest, so the Windows jobs run it without a separate CI command. Cases, each with its control:
X2W_TRAP_LOG: the launcher reportsexit code 0x00000007and the three captured files hold those bytes;--timeout 1: the launcher reports the timeout, terminates the job (0xdead0001) and returns within the timeout;--memory-giballows and the allocation fails, then succeeds under a larger cap);CreateProcess failed, launcher exit code 2);--max-processesblocking a grandchild, with the larger limit as the control.Verification is the ctest run itself plus the pre-fix control: each assertion names the launcher line it reads, and case 4 fails today only because no check reads it. I will report the measured output.
AI-assisted (Claude Code).
triggered02 commentedon Nov 24, 2026
Opened #1261 for the launcher-check slice: a source-built probe plus a ctest that reads back what
tools/startup/launch.pyclaims to guarantee.tests/startup_launch_probe.cppwrites known bytes to stdout/stderr/X2W_TRAP_LOG, reports a known exit code, or asks for more memory, spawns a helper or stays alive.tests/startup_launch_check.py(cteststartup_launch) checks the exit-code report, the three captured files, the--timeoutkill,--memory-giband--max-processes(each with the larger limit as the control) and the missing-EXE path.prpreset builds the probe and runs the test, so the Windows jobs run it on pull requests; main-branch runs pick it up with the rest of the suite.docs/startup-runtime.mdhas the command.Local measured output on a release configuration:
1/1 Test #217: startup_launch ... Passed 1.76 sec, withallocate failed error=1455vsallocate ok 1024 MiBandspawn failed error=1816vsspawn okfor the controls. Removing either job limit flag or the trap-log environment fromlaunch.pymakes the check fail with a specific assertion, so the cases are not vacuous.This does not touch
gfx2hlsl.py,debug_launch.pyor the stand-in device source. I have not added the general Python syntax pass overtools/startup/; I can do that as a second small PR if you would rather have it separate.AI-assisted (Claude Code).
translator: check 3D image sampling with a source-built draw
tests: use wide-character path APIs in the launch probe
tedin7 commentedon Nov 24, 2026
Taking one more untested tool under this issue, per the note above:
tools/startup/capture.py, the reader forcapture.bin(no test covers it today). I will not touch the launcher check (#1261),gfx2hlsl.pyordebug_launch.py.Plan:
tests/startup_capture_check.pyregistered as cteststartup_capture, with a syntheticcapture.binbuilt byte for byte from the record layouts insrc/startup_stubs/d3d12_capture.inl(FRAM, CALL, MEM, PSO, ROOT, RES, HEAP, OBJ, VIEW, TABL, TGTS, PRES):D3D12_RESOURCE_DESCblocks of RES;Memory.readreturns the bytes captured last at or before a call sequence, and a different one for an earlier sequence;The writer is not changed. Draft PR to follow.
tests: check the launch tool's containment on a source-built probe
R0Y00 commentedon Nov 24, 2026
#1261 is now on main. The Windows PR smoke job built the source-only probe and ran
startup_launchin 1.45 s. It exercised exit-code and stream capture, timeout, commit and child-process limits with their permissive controls, and a missing executable. The broader startup-stand-in CI checklist above is still open.RenzoWit35 commentedon Nov 24, 2026
Taking one more untested stand-in behavior under this issue: the DirectStorage stand-in's zlib decoder,
src/startup_stubs/inflate.h. The existing stub-consumer fixtures only reach stored blocks, a fixed block that repeats one byte at distance 1, and single-byte runs. With the last distance code's extra bits changed from 13 to 12 and the match-distance check removed,startup_stubsandstartup_storage_directory_batchstill pass. I will not touchxcrdapi.cpp, the BCPack decoder (#1390),debug_launch.pyorrun.ps1.Plan: a source-built probe that runs
inflate_zlibon one stream into a destination with guard bytes on both sides, plustests/startup_inflate_check.py(cteststartup_inflate):The decoder is not changed. PR to follow.
AI-assisted.
runtime: check the zlib decoder's distance bound on bare deflate data
runtime: check the DirectStorage stand-in's zlib decoder against zlib
Asimmimx commentedon Nov 24, 2026
Three more untested stand-in behaviors, one PR each. Each one is a device-free C++ check of a single
src/startup_stubsheader, found by single-point mutation against the existing CPU and WARP tests. None of the three changes the header or the device code.derived_blend.h(slot 55 blend-patch scan). Thestartup_stream_drawtests do not see the returned descriptor offset, the whole-record check or the null check. Three of nine mutants survived those tests.logical_view_table.h(root table windows and records).startup_logical_view_*skips (77) on WARP and on an RX 6600, and the other draws bind a one-record table at offset 0. Six of six mutants survived.bc7_4k_s.h(BC7 4 KiB standard sizes, block order and detile). The existing checks use only square tile grids and accepted descriptions. Thetile_rows-for-tile_columnstile index, a droppedMipLevelscondition and a droppedAlignmentcondition all survived.Each PR has its mutation table and the exact commands. Their CMake blocks are separated, so they merge in any order. I am not touching the other slices claimed here.
AI-assisted (Claude Code).
Asimmimx commentedon Nov 24, 2026
More untested stand-in behaviors, one PR each. Each was found by single-point mutation against the existing CPU and WARP tests. Every PR has its mutation table and exact commands, changes only tests, CMake and docs, and merges in any order with the others.
translated_sampler_bindings.h: sampler word decoding per axis, filters, anisotropy and border,smpheaplines, snapshot counts and equality. 14 of 16 mutants survived.local_log.h: switch values, kept last error, CRLF, truncation at 1,533 bytes, trap-log append andMAX_PATH. 10 of 12 survived.slice_footprints.h: re-read rules,supports(), the mip limit, the null-device guard and the last-row span. 10 of 14 survived.dstorage_file_read.h: reads at offsets above 2 and 4 GiB. ClearingOffsetHigh, shifting by 31 and a 32-bit size all survived.null_binding_cause.h: the slot and label each cause lands in on the totals line.placement_publish.h: the exclusive lock and themax_widththat binding lookup relies on.memory_srv_report.h(follow-up to gpu: log the exact fields of a refused slot 70 memory SRV call #1420): 2D and array view fields, raw words and 64-bit values in the slot 70 refusal line. 9 of 11 survived.Outside the stand-ins:
startup_stubsno longer leaves anx2w_trap_*folder in%TEMP%on each run.AI-assisted (Claude Code).
29 remaining items
tests: cover classify_null_binding precedence rules and 512-state tru…
tests: cover ViewHeapSelection and ComputeTables state and bounds
tests: cover ViewTable bounds, sampled_table_neighbor, and resolve_vi…
tests: cover standin_exports catalog builders and validation
tests: cover bcpack_recover_constants parsing, recovery, and SHA-256 …
tests: cover ffx_recurrent generation and identity validation
tests: cover x2w_console_mode helpers, boundaries, and status codes
tests: cover FrozenComputeRequests eviction, capacity bounds, and con…
tests: cover list_copy_texture alignment, partial MSAA, and footprint…
tests: cover x2w_inflate blocks, Huffman errors, Adler-32, and zlib f…
tests: cover DxilModule resource handles, ViewID matrix, and loop dep…
tests: cover guest shader container parser and identifiers
tests: add CI regression guard for startup_stubs coverage
tests: add D3D12 and xmem lease tests for xmem_section_buffer.h
tests: cover shader_compute_request parsing, keys, and validation (#3734