Skip to content

startup: write shader requests from the shader archive before a run - #1750

Merged
R0Y00 merged 9 commits into
R0Y00:mainfrom
NiiRoZz:startup/archive-shader-requests
Nov 25, 2026
Merged

R0Y00 merged 9 commits into
R0Y00:mainfrom
NiiRoZz:startup/archive-shader-requests

Conversation

@NiiRoZz

@NiiRoZz NiiRoZz commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Change

Shader translation requests used to exist only after the title created a pipeline, so every new pipeline cost a run before it could be drawn. This adds tools/startup/archive_requests.py, which writes runtime-keyed requests from the shader archive, without starting the title:

python -B tools/startup/archive_requests.py <package root>\shaders.rpf out/startup/shader_cache
python -B tools/startup/gfx2hlsl.py --pending out/startup/shader_cache

How the format was found:

  • A startup run traced every DirectStorage read (10,513 reads) and matched each recorded request blob's address to the read whose destination covered it.
  • Every native program in the measured window came from zlib streams in the shader archive that start on 64-byte boundaries and inflate to 64 KiB.
  • Inflated offline, those streams hold the exact bytes the runtime records. extract_shaders.py reads a different record structure in the same file and does not see them.

What the tool does:

  • Inflates every complete zlib stream on the 64-byte grid, and joins a stream with the one starting on the next 64-byte boundary, so a program split between two streams is carved whole.
  • Carves each program: a 36-byte header, then s_inst_prefetch, padded in 64-byte blocks, starting on a 256-byte step. A program ends at an all-zero block or at the next program's header.
  • Requires each carved program to contain s_endpgm. A program cut short by an all-zero block is counted as incomplete and never paired.
  • Pairs each pixel program with a vertex program that starts on the very next 256-byte step (a = pixel, b = vertex, the order the runtime records). In every measured pipeline the vertex program directly follows its pixel program.
  • Writes req_<key>.{a,b,root} with the runtime's key: .b and .root first, then .a, each through a temporary file and a rename.

What it cannot take from the archive (documented):

  • Root signatures. None of the recorded roots occurs in the archive or the executable. The tool reads req_*.root from earlier runs (by default the cache) and writes each pair once per distinct root. Unused combinations cost translation time and nothing else.
  • DXBC programs embedded in the executable.
  • Non-adjacent pairings.
  • A program cut off at the end of a joined run of streams.

Refs #1723 (the translator census this population produced, with a per-pair correction in its comments).

Verification

Branch head 754dd51f (615189af plus two commits addressing review findings: strict adjacency and s_endpgm, then an inflate limit, write-failure handling and independent test keys), on main at a4d17cf5. Windows 11 (26300), Python 3.13.

python -B tests/startup_archive_requests_check.py   # startup_archive_requests_check passed
python -B tests/startup_gfx2hlsl_capture_check.py   # passed
python -B tests/docs_links_check.py                 # 17 files, 365 links
python -B tests/bidi_controls_check.py              # no bidirectional controls

The synthetic test builds an archive from documented encodings: exp and s_endpgm words plus s_inst_prefetch, with no title bytes. Each adjacent pixel/vertex pair must become one request per root, with the key computed by the test's own copy of the runtime's FNV-1a (not gfx2hlsl.pipeline_key) and exact parts. Controls that must write nothing:

  • a pixel program followed by a pixel program;
  • a vertex program with no pixel program before it;
  • a vertex program one empty 256-byte step after its pixel program;
  • a pixel program without s_endpgm;
  • a pair whose vertex program reaches the end of its stream;
  • a valid pair in a stream that is not on the 64-byte grid;
  • a duplicate root;
  • a missing --roots path, and a cache without roots (both refused with a message).

A pair split between two consecutive streams must be carved whole, and a second run must write nothing new.

Mutation checks, each run against a temporary edit that was then reverted. Every mutant failed the check:

Mutant Result
Pair any stage with any previous program extra keys
Keep programs that reach the end of a stream extra keys
Accept streams on a 32-byte grid extra keys
Remove the no-roots refusal "refused with a message" fails
Do not join consecutive streams split pair missing
Ignore the adjacency rule extra keys
Ignore the s_endpgm rule extra keys
STEP 0x100 → 0x40 pairs lost
.a written before .b / .root .a left behind a blocked .root
Header-tag check dropped extra keys (untagged control)
at % 4 check dropped extra keys (offset …2e control)
Empty root kept extra keys
No inflate limit oversized count wrong
Temporary file left after a failed write .tmp found
Write failure or no pairs exits 0 exit status

Local data, not in the repository. On a Scarlett package's shader archive (the adjacency and s_endpgm rules left these counts unchanged: 0 incomplete programs) the tool joined 1,079 zlib streams into 800 runs, carved 4,982 programs (2,730 pixel, 2,115 vertex, 137 other) and wrote 3,774 requests for 1,258 pairs and three recorded roots in 22 s. A cold startup run recorded eleven pipelines:

  • 8 were among the offline requests with identical keys, and their <key>.txt, both .hlsl files and both .cso files were byte-identical to the run's.
  • 2 are DXBC containers embedded in the executable.
  • 1 was not carved, either created after the traced window or from another source.

Translated on its own, the population gives 104 of 1,171 pairs that translate under at least one root (measured before stream joining). The refusals are tracked in #1723.

Evidence and follow-up

Checklist

  • This pull request covers one reviewable behavior: writing shader requests from the archive.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

Translation requests were only written when the title created a
pipeline, so every new pipeline cost a run before it could be drawn.
A traced startup run showed the native programs come from 64-byte
aligned zlib streams in the shader archive, byte for byte.

tools/startup/archive_requests.py inflates those streams, joins a stream
with the one that starts on the next 64-byte boundary, carves programs
(36-byte header, s_inst_prefetch, 64-byte blocks on 256-byte steps) and
pairs each pixel program with a directly following vertex program. Root
signatures are not in the archive, so they come from earlier req_*.root
files and every pair is written once per distinct root, with the
runtime's key. gfx2hlsl.py --pending then translates them.

Measured locally: 4,982 programs, 1,258 pairs, 3,774 requests in 22 s.
Eight of the eleven pipelines of a cold run were among them with
identical keys and byte-identical translations.

Test: startup_archive_requests on a synthetic archive, with controls for
unpaired programs, a pair cut off at the end of a stream, a stream off
the 64-byte grid, a pair split across two consecutive streams, missing
roots and a second run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of head 615189a (comment only, not an approval). First review of this PR; the base is a4d17cf and main is now 10 commits ahead. I read the diff, not the existing comments.

Verdict: 0 P1 / 2 P2, plus nits.

P2-1: inflate is unbounded (tools/startup/archive_requests.py, chunks() and streams())

  • inflater.decompress(window) has no max_length, and streams() keeps every consecutive stream in joined until a gap appears. A stream of at most 128 KiB can inflate to about 100 MB.
  • Repro: python3 -B tools/startup/archive_requests.py bomb8.bin cache --roots roots with a 796 KB archive of 8 consecutive zlib streams, each inflating to 100 MiB: /usr/bin/time -v shows Maximum resident set size 1669384 kB, exit 0.
  • The PR's premise is that a stream inflates to 64 KiB, so a max_length check (reject above about 1 MiB) and a cap on joined are cheap. The archive is the user's own input, hence P2.

P2-2: the tests do not guard several behaviours the PR text and docs claim

  • "Every mutant failed" covers only the 5 listed mutants. Of my production mutants, 5 were not caught (table below).
  • The test computes expected keys with gfx2hlsl.pipeline_key, the function the tool uses, so a wrong key formula or argument order cannot be seen; it also asserts stdout text such as pairs=4 written=8 streams=3.

No finding

  • Path traversal: output names come only from 'req_%016x' % key, the archive carries no names, and the cache and roots paths come from argv.
  • Atomic publish: each file is written to <name>.<pid>.tmp and os.replaced in the order .b, .root, .a; a concurrent run writes identical bytes, and the .a check gives idempotence.
  • Garbage input: 300 random programs raised nothing except gfx2hlsl.Unsupported; a truncated stream is skipped; an empty archive returns early. Fixtures are synthetic.

Run (worktree at the head)

  • python3 -B tests/startup_archive_requests_check.py: passed. tests/startup_gfx2hlsl_capture_check.py: passed. docs_links_check (17 files, 365 links), bidi_controls_check (1300 files), git diff --check origin/main...HEAD: clean.
  • Production mutations in archive_requests.py (each restored with git checkout --). Caught: keep a program that reaches the end of its stream; pair a vertex program with any previous program; drop the root dedupe; drop the existing-.a skip; swap the pipeline_key arguments; drop the 64-byte rounding of the stream end; do not join consecutive streams. NOT caught: STEP 0x100 -> 0x40; writing .a first instead of last (the marker order is untested); dropping the header-tag check; dropping the at % 4 == 0 check; keeping empty root files.

Nits

  • pipeline_key(vs_code, ps_code, root) is called with (ps, vs); consistent with translate_request but the parameter names mislead, so a comment would help.
  • read_roots uses open().read() without closing; a failed write leaves a .tmp file; zero streams or zero pairs exits 0, so pointing it at a wrong file looks like success; req_*.root files from older runs are read from the cache by default (documented).
  • The docs paragraph runs the "Check with ..." sentence into the measurement paragraph.
  • Overlap: #1749 (parallel translation during a run) reads req_*.a as the ready marker this PR relies on, and #1641 touches the same area; all three edit the CMake and AGENTS.md test lists, so expect trivial conflicts. I did not check them semantically.

Not run: PowerShell, run.ps1, the real archive, the fxc translation, ctest, YAML parsing of windows.yml (PyYAML missing; the change is one list line). C++, llvm-mc and shader forms do not apply to this diff.

Linux limits: no Windows, WARP, DXC or GPU here; LLVM 19 only (CI pins LLVM 15). Anything that needs them was not run.

AI-assisted; commands listed were executed locally.

NiiRoZz and others added 2 commits November 24, 2026 19:28
- "Directly following" is now enforced: a vertex program pairs only when
  it starts on the 256-byte step right after the pixel program. Before,
  any vertex program after a pixel program paired, whatever the gap.
- A carved program must contain s_endpgm; one cut short by an all-zero
  block is counted as incomplete and never paired.
- The memory map is closed, and the docs use a neutral <shader archive>
  placeholder.

On the local archive both rules leave the result unchanged (1,258 pairs,
0 incomplete, 8 of 11 recorded keys), so every measured pair was already
adjacent. The test adds a gap pair and a program without s_endpgm as
controls, and a mutation of each rule is detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up.

- A zlib stream that would inflate past 1 MiB (a measured one inflates
  to 64 KiB) is counted as oversized and skipped without inflating it in
  full, and a joined run of consecutive streams stops growing at 64 MiB.
  Before, a small crafted archive could make the tool allocate gigabytes.
- A part that cannot be written leaves no .a and no temporary file and
  the run exits with an error; an archive without any pair also fails.
  Root files are read with a context manager.
- The test computes the expected keys with its own copy of the runtime's
  FNV-1a (start value 1469598103934665603, as in d3d12_draw.inl) instead
  of gfx2hlsl.pipeline_key, parses the summary, and adds controls for an
  untagged program, a pair at offsets not a multiple of 4, an empty root
  file, an oversized stream, a blocked .root write and an archive
  without pairs.

All nine mutants (step size, write order, tag check, alignment check,
empty roots, inflate limit, temporary file cleanup, and both failure
exits) are detected. The local archive gives the same 1,258 pairs and
8 of 11 recorded keys, with 0 oversized streams.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NiiRoZz

NiiRoZz commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Everything is addressed in 754dd51f. The review was on 615189af; c357c8d3 had already enforced strict adjacency and required s_endpgm.

P2-1, unbounded inflation.

  • inflater.decompress(window, MAX_INFLATE) with a 1 MiB limit (a measured stream inflates to 64 KiB). A stream that hits the limit without ending is counted as oversized and skipped, never inflated in full.
  • A joined run of consecutive streams stops growing at 64 MiB.
  • The test adds a stream that inflates to 2 MiB and expects oversized=1. Removing the limit is detected.

P2-2, test independence and mutants.

  • Expected keys now come from the test's own FNV-1a, written from fnv_bytes / cached_translation in d3d12_draw.inl, not from gfx2hlsl.pipeline_key. Side note: the runtime's start value is 1469598103934665603, one digit short of the standard offset basis 14695981039346656037. The test reproduces it as written, because the existing cache keys depend on it.
  • The summary is parsed into a dict instead of matched as text.
  • All five of your mutants are now detected, each by a new control:
Mutant Detected by
STEP 0x100 → 0x40 adjacency check (pairs are lost)
.a written before .b / .root a directory blocks one .root; no .a may exist for that key
header-tag check dropped an untagged pixel program before a vertex program
at % 4 check dropped a complete adjacent pair at offsets …2e
empty roots kept an empty req_*.root in the roots directory

Four more mutants are also detected: the inflate limit removed, a temporary file left after a failed write, a write failure exiting 0, and an archive without pairs exiting 0.

Nits.

  • The pipeline_key(ps, vs) argument order now has a comment: the runtime hashes its first recorded blob first, and only the order matters.
  • read_roots uses with.
  • A failed write removes its temporary file, leaves no .a, and makes the run exit 1.
  • An archive without pairs exits 1.
  • The docs split the "Check with" paragraph out of the measurement paragraph.

On the local archive the result is unchanged: 1,258 pairs, 0 incomplete, 0 oversized, and 8 of 11 recorded keys.

On the overlap: this PR and #1749 each add one line after startup_gfx2hlsl_capture_check.py in AGENTS.md and the workflow, so whichever lands second gets rebased.

AI-assisted (Claude Code).

NiiRoZz and others added 3 commits November 24, 2026 19:59
Keep both new test registrations in CMakeLists.txt (startup_archive_requests
and upstream's startup_gfx2hlsl_op_refusals).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… support

main now refuses some forms inside gfx2hlsl.decode (v_cndmask_b32_e64
with NEG on an immediate), and gfx2hlsl.classify goes through decode, so
289 carved programs became "undecodable" and 143 pairs were lost. Which
programs pair must not depend on whether they can be translated.

stage_of() applies the same export-target rule as classify but reads the
disassembler directly. The local archive is back to 1,258 pairs with 0
undecodable programs, and 8 of the 11 recorded pipelines, re-keyed with
the current revision, are among the offline requests.

The test reads the key revision from src/startup_stubs/d3d12_draw.inl
(main bumped it to x2w-startup-shader-4) instead of hard-coding it, and
one vertex program now contains that refused v_cndmask form; going back
to classify() loses the pair and is detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R0Y00#1749 adds its check right after startup_gfx2hlsl_capture_check.py in
AGENTS.md and the workflow, as this PR did, so whichever merged second
conflicted. This entry now sits two lines further down, so the two PRs
merge in either order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NiiRoZz

NiiRoZz commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (conflict in CMakeLists.txt only: both new test registrations kept). Merging surfaced one behaviour change, fixed in 92f8c6cd:

  • main now refuses v_cndmask_b32_e64 with NEG on an immediate inside gfx2hlsl.decode, and gfx2hlsl.classify goes through decode. On the local archive, 289 carved programs became "undecodable" and 143 pairs were lost.
  • Whether a program can be translated should not decide its pairing. stage_of() applies the same export-target rule as classify but reads the disassembler directly. The result is back to 1,258 pairs with 0 undecodable. The 11 recorded pipelines, re-keyed with the current revision, still give 8 of 11.
  • The test now reads the key revision from d3d12_draw.inl (main bumped it to x2w-startup-shader-4). One synthetic vertex program contains that refused v_cndmask form; going back to classify() loses the pair and is detected.

b3d3ea13 moves this PR's entry in AGENTS.md and the workflow two lines further down. #1749 and this PR now merge into main in either order without conflicts (checked both orders with git merge-tree), so the rebase I mentioned earlier is no longer needed.

AI-assisted (Claude Code).

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at head b3d3ea1368d2d4a3af458408f898b6cb5481dfe2 (comment only, not an approval). The earlier review was at 615189af; I read the diff against current main and the author's replies.

Verdict: 0 P1 / 0 P2, two P3. Both P2 findings of the first review are resolved.

Earlier findings

  • P2-1, unbounded inflate: resolved. inflater.decompress(window, MAX_INFLATE) caps one stream at 1 MiB and MAX_JOINED caps a joined run at 64 MiB. I rebuilt the earlier repro (8 consecutive zlib streams, each inflating to 100 MiB, an 815,593-byte archive): the run now ends in 0.23 s with a maximum resident set of 27 MB (it was 1,669,384 kB), reports oversized and exits 1 with "no program pair found".
  • P2-2, tests: resolved for the five mutants I listed. I re-ran them, plus others; each makes the test print FAIL now: STEP 0x100 to 0x40, .a written before .b and .root ("no ready marker"), header-tag check dropped, at % 4 check dropped, empty roots kept. Also caught: inflate limit removed, pair accepted without adjacency, pipeline_key arguments swapped, complete() always true. The expected keys now come from the test's own FNV-1a and the revision text from d3d12_draw.inl, the summary is parsed into a dict.

Findings

  • P3, the 64 MiB cap on a joined run is not guarded. Mutation: size + len(data) > MAX_JOINED replaced by False in tools/startup/archive_requests.py (streams()); tests/startup_archive_requests_check.py still passes. The PR text and docs/startup-runtime.md state the cap. A guard needs about 65 consecutive streams of 1 MiB of zeros (a few KB of archive) and a check that the joined run is split.
  • P3, the key order is an empirical claim. The tool hashes the pixel program first (pipeline_key(previous[2], program, root)), while gfx2hlsl.pipeline_key names its first parameter vs_code, and the runtime hashes stages[0] / words[5] first (d3d12_draw.inl:271, :357). The comment added in this head says only the order matters, and the "8 of 11 recorded keys" in the PR text supports a = pixel, but I could not check it here (no real archive or run). The synthetic test pins only that the tool and the test agree.

Other things I checked, no finding

  • Path traversal: names come only from 'req_%016x' % key; the archive carries no names.
  • Write order and failure: .b, .root, .a last, each through <name>.<ext>.<pid>.tmp and os.replace; a blocked .root leaves no .a and no temporary file and exits 1 (the test covers it).
  • Dense hostile input: streams of 0xFF filler with a program header every 68 bytes took 0.8, 1.0, 1.7 and 4.1 s for 64 KiB, 128 KiB, 256 KiB and 1 MB, memory flat at 27 MB. growth was roughly linear in these sizes.
  • The merge-driven change (stage_of() reading the disassembler directly instead of gfx2hlsl.classify) matches the export-target rule it documents; the test has a vertex program with a refused v_cndmask_b32_e64 form to keep pairing independent of translatability.

Commands run (Linux, worktree at the head)

  • python3 -B tests/startup_archive_requests_check.py: passed. python3 -B tests/startup_gfx2hlsl_capture_check.py: passed.
  • tests/docs_links_check.py (17 files, 368 links), tests/bidi_controls_check.py (1313 files), git diff --check origin/main...HEAD: clean. git merge-tree against current main: no conflicts.
  • Mutations in archive_requests.py as listed above, each restored with git restore; git status --short clean afterwards.

Limits: Linux only. I did not run PowerShell, a real archive, the fxc translation or ctest, and the Windows 2025 runner script could not be used in this session, so nothing in this diff was run on Windows.

AI-assisted; commands listed were executed locally.

130 consecutive 512 KiB zlib streams (65 MiB inflated, a few KB on
disk) must come out as two joined runs. Before, removing the cap still
passed the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NiiRoZz

NiiRoZz commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks.

  • MAX_JOINED: covered in 3543b489. 130 consecutive 512 KiB streams (65 MiB inflated, a few KB on disk) must come out as two joined runs. Replacing the cap condition with False now fails the test.

  • Key order: the runtime hashes the first recorded blob first (a in cached_translation). In every pipeline this tool covers, that first blob is the pixel program; pipeline_key's first parameter is named vs_code, but only the order is used. The evidence is the local measurement in the description, re-checked after merging main:

    • 8 of the 11 pipelines a cold startup run recorded are among the offline requests with identical keys (re-keyed with the current x2w-startup-shader-4 revision);
    • for those 8, the run's <key>.txt, .hlsl and .cso files were byte-identical to the offline ones.

    With the pair swapped, none of the 8 would match. I'd leave renaming the gfx2hlsl parameter to a separate change, since this PR doesn't touch gfx2hlsl.py.

AI-assisted (Claude Code).

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retest at head 3543b48 (comment only, not an approval). Earlier review was at b3d3ea1.

Result: no P1/P2 findings. The delta is one file, tests/startup_archive_requests_check.py (13 insertions, 1 deletion), and it resolves the earlier P3 about the 64 MiB joined-run cap: the check builds 130 consecutive 512 KiB zero streams (65 MiB inflated) and requires the summary to report streams=2.

Linux checks run locally in a clean worktree at this head:

  • git diff --check origin/main...HEAD: clean
  • tests/docs_links_check.py: passed (17 files, 368 links)
  • tests/bidi_controls_check.py: passed (1313 files)
  • tests/startup_archive_requests_check.py: passed
  • tests/startup_gfx2hlsl_capture_check.py: passed

Mutation (local, reverted, tree clean afterwards): in tools/startup/archive_requests.py, 'size + len(data) > MAX_JOINED' replaced by 'False'. The check exits 1 with "FAIL joined run capped at 64 MiB: got '1', want '2'".

Win2025 (Windows Server 2025 build 26100, WARP, coordinator run, full default target set): Debug dev and Release /O2 builds succeeded; startup_stubs and startup_stream_request_warp 2/2 passed in both (Debug 1.49 s, Release 1.53 s). Windows Python check tests/startup_archive_requests_check.py ok (1.4 s).

Still open from the earlier review (P3, unchanged): the key order (pixel program hashed first) is an empirical claim that this session could not check against a real archive.

AI-assisted; commands listed were executed locally.

Keep both test-list entries in AGENTS.md and the workflow (this PR's
archive check and upstream's new scalar/SOP2 checks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r-requests

# Conflicts:
#	.github/workflows/windows.yml
#	AGENTS.md

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of head 74a3460c77bcf85645b2ac8360ca054512f0c9ef (comment only).

Scope: tools/startup/archive_requests.py (new), tests/startup_archive_requests_check.py (new), docs/startup-runtime.md, plus CMake/CI/AGENTS.md registration of the new check. Title is neutral. Mergeable. CI: Linux Python checks, gfx1013 fixtures and Windows build/test all pass (the /O2 and chart jobs were skipped).

Commands run locally (Linux, worktree at the head SHA):

  • python3 -B tests/startup_archive_requests_check.py -> startup_archive_requests_check passed
  • python3 tests/docs_links_check.py -> passed (18 files, 396 links)
  • python3 tests/bidi_controls_check.py -> passed (1430 files)
  • git diff --check origin/main...HEAD -> clean

Mutations (each reverted with git checkout -- .):

  1. Swap the pair order in pipeline_key(program, previous[2], root) -> test fails (request keys and downstream checks).
  2. Drop the at == next_step(...) adjacency condition -> test fails (second run count 10 vs 8).
  3. Disable the existing early-return in write_request -> test fails (second run written 8 vs 0).
    All three were killed, so the new logic is well covered.

Findings

  • P1: none.
  • P2: none.
  • nit archive_requests.py:94: only a zlib header of 0x78 is accepted. Streams with other CMF/FLG levels (for example 0x48) are skipped silently. The docs say "measured archive", so this is fine, but a counter for skipped candidates would make a miss visible.
  • nit archive_requests.py:96-98: WINDOW is 128 KiB of compressed input. A valid stream longer than that is dropped without a counter (only the inflated-size cap is counted as oversized). Consider counting it.
  • nit archive_requests.py:35: complete() accepts any 4 bytes matching s_endpgm at a 4-byte offset. This could also match an inline literal. Low risk, because the pair is also gated on stage and position.
  • nit: every pair is written once per distinct root. With many roots in the cache this multiplies files. The behavior is documented, so I only note it.

Not run: Windows/WARP (win2025). This is an offline Python tool with no shader lowering or C++ change, and Windows CI already passed.

AI-assisted; commands listed were executed locally.

@R0Y00
R0Y00 merged commit 106603a into R0Y00:main Nov 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants