Skip to content

ci: build the startup stand-ins and run their checks in CI #1149

Backlog

Description

@denn0x

Proposal

  • 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.

AI-assisted (Claude Code).

Activity

  1. R0Y00 commented on Nov 24, 2026

    @R0Y00
    Owner

    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.

  2. R0Y00 commented on Nov 24, 2026

    @R0Y00
    Owner

    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.

  3. Jess-Doit commented on Nov 24, 2026

    @Jess-Doit
    Contributor

    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.

    1. 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.
    2. 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.

    AI-assisted (Claude Code).

  4. triggered02 commented on Nov 24, 2026

    @triggered02
    Contributor

    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:

    1. 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;
    2. the same fixture in sleep mode with --timeout 1: the launcher reports the timeout, terminates the job (0xdead0001) and returns within the timeout;
    3. a commit-cap case (the fixture asks for more than --memory-gib allows and the allocation fails, then succeeds under a larger cap);
    4. the missing-EXE error path (CreateProcess failed, launcher exit code 2);
    5. 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.

    AI-assisted (Claude Code).

  5. triggered02 commented on Nov 24, 2026

    @triggered02
    Contributor

    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.

    AI-assisted (Claude Code).

  6. tedin7 commented on Nov 24, 2026

    @tedin7
    Collaborator

    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.

    The writer is not changed. Draft PR to follow.

  7. R0Y00 commented on Nov 24, 2026

    @R0Y00
    Owner

    #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.

  8. RenzoWit35 commented on Nov 24, 2026

    @RenzoWit35
    Contributor

    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).

    The decoder is not changed. PR to follow.

    AI-assisted.

  9. Asimmimx commented on Nov 24, 2026

    @Asimmimx
    Contributor

    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.

    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).

  10. Asimmimx commented on Nov 24, 2026

    @Asimmimx
    Contributor

    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.

    Outside the stand-ins:

    AI-assisted (Claude Code).

  11. 29 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions