startup: accelerate gfx2hlsl cache scans and support skipping earlier failures #2899
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2899"
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 Holastor on 2026-11-26T17:13:05Z.
Summary
In caches with tens of thousands of requests (e.g. 16,000+ files),
pending_keysandrequest_keysintools/startup/gfx2hlsl.pyrepeatedly calledos.listdir()and invokedos.path.exists()/os.path.getmtime()per request and per dependency (.psin,.psdep,.fail,.cso,.txt). On Windows (NTFS), this incurred tens of thousands of individual filesystem metadata queries per pass, causing repeated scans and--watchpasses to saturate CPU time and stall for several seconds or minutes on large sets of already-refused requests.This change:
os.listdirwithos.scandirinpending_keysandrequest_keys, collecting directory entries and their stat attributes (st_mtime,st_size) in a single pass in memory.completedmap passed across--watchiterations: tracks published requests, their description mtimes, and published stage metadata (st_size,st_mtime). If any stage file is truncated, deleted, or modified, or if a description or ready marker changes, the warm result is invalidated and falls through to the full verification check (has_complete_mesh57_bytecode, including mesh-onlyps nonecases).--skip-failed(-s) CLI flag andX2W_SKIP_FAILED=1environment variable. When set, one-shot--pendingscans and the initial--watchpass skip requests whose.failfile is newer than their ready marker and stream description, avoiding repeated refusal processing across large known-unsupported request sets.--jobs(-j) CLI flag to configure worker concurrency alongsideX2W_TRANSLATE_JOBS. CLI argument parsing separates option values from positional interval arguments, ensuring--watch <dir> --jobs 4does not treat the worker count as the sleep interval.--jobsargument and theX2W_TRANSLATE_JOBSenvironment variable throughtranslation_jobs(jobs=None), uniformly enforcing the Windows worker limit (max_workers <= 61) across one-shot--pendingand--watchmodes.docs/startup-runtime.mdand extendstests/startup_gfx2hlsl_watch_check.pyto verify caching, stage truncation invalidation (dual stage andps none),--skip-failed, and worker pool capping controls across 62 synthetic requests.Evidence
Unit tests and link checks:
Commit
cf544ede, rebased on upstream/main ate446b072. Windows 11, Python 3.14.All passed with 0 failures:
startup_gfx2hlsl_watch_check passed(including warm-cache truncation controls,--watch --jobsCLI parsing controls, and 62-request Windows worker capping controls)startup translator checks: 0 failedSelf-test passed. Checked 40 Markdown files and 555 links.no bidirectional controlsrun_checks_parallel_check: okBenchmark on synthetic and real request caches:
pending_keysscan time reduced from ~680 ms to ~22 ms.--watchtick with no new requests reduced from ~410 ms to ~17 ms..failrequests):python -B tools/startup/gfx2hlsl.py --pending <dir> --skip-failedcompleted in 196.8 ms.Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T17:37:12Z.
Independent Linux result on
fde6cbd0: the scan returns the same keys asmainon 1 000 scans, and three mutations of the new completion cache leave the fixture greenNot a code change; measurements only.
pending_keysis pure Python, so this is a CPU run: no adapter, no draw, nothing here speaks to Windows.Environment
fde6cbd0(head) and6ee878d8(main, the base this PR declares) in two worktrees;git diff --stat origin/main...HEADis the three files of the PR.7.0.0-38-generic, ext4, Python 3.11.16, 2 vCPU. No MSVC build, no ctest.ubuntu-24.04with Python 3.12 (python-linuxjob,.github/workflows/windows.yml:294), hence 3.11.16 here. On a pull request that job is the only place these assertions run: the Windowsprtest preset (CMakePresets.json:44-45) does not namestartup_gfx2hlsl_watch(CMakeLists.txt:3487), which only thedevpreset picks up onmain(windows.yml:494).1. The fixture passes, and the rewrite returns the same key set as
mainThe two
translator errorlines and the interrupted pass are injected by the fixture itself.Then a differential run on 250 generated caches (markers
.a/.rtv/.c67/.m57; description older or newer than the manifest; complete, empty or truncated.csofor each stage;.psdep;.failolder or newer than its marker), both revisions, four modes:Counted coverage: 116
.a, 67.rtv, 27.c67, 23.m57; 44 requests carrying a.psdepwith no description. The generator cannot emit two markers for one key and holds no RTV variant whose source exists; both were exercised by hand (description rewritten, description removed, meshps nonewith a single.cso, truncated mesh container, empty and valid.cs), agreeing every time.One class does differ: an
.rtvmarker whose linerequest_sourcerefuses, plus areq_<key>.psinfor the variant's own key newer than its published manifest.mainkeeps the result, the head re-translates (it falls back tobase = keyinside thesuppressat:11897-11899). A corrupted variant marker plus a 64-bit name collision is not something the runtime writes, so I record it rather than call it a defect.2. What the fixture pins:
--skip-failed, but not the cache's invalidationSingle-line mutations of
tools/startup/gfx2hlsl.py, applied alone, sha256 before and after, tree restored withgit checkout --(finalgit status --porcelain --untracked-files=noempty, file back at3df03232).Caught by the fixture:
Not caught — fixture
rc=0, every assertion green:Each silences one invalidation the summary promises: rewriting the description, withdrawing the manifest, losing the stage bytecode.
P1/P2/P3below are those three cases, one directory scanned twice with the samecompleteddict. An unmutated head re-verifies all three, asmaindoes:[2]= pending again, i.e. re-verified;[]= the cache answered "done". Each mutant breaks exactly one of the three.So the code is right today, but nothing in
startup_gfx2hlsl_watch_check.pywould notice if it stopped being right: the only cache assertions are lines 81-84 — one hit (2 in completed) and one rescan of unchanged files. Acrosstests/there are exactly two calls that passcompleted=(lines 82 and 84), both without any file changing in between. That is the property the summary's point 2 claims ("If a request marker or dependency is rewritten, the entry drops fromcompletedand is re-verified").Measured nuance on M1: of the two conditions on that line, only
manifest_name in fileschanges the returned list — rewriting the request marker alone gives the same list on both revisions, so that half is untestable this way.3. Two things in the new code worth a second look
except TypeErrorinwatch_pass(:11767-11770) has no production caller that needs it. Removing it makes the fixture fail withTypeError: broken() got an unexpected keyword argument 'completed'—broken(tests/startup_gfx2hlsl_watch_check.py:262) is a two-argument stub, and every other caller goes throughwatch_pass, which always passescompleted. It also swallows aTypeErrorraised inside a real pass: with a full-signature stub that raises on its first call, the pass runs twice and returnsTrue(calls=2 with_cache=[True, False] pass_reported_complete=True). A three-argument stub would let the shim go.:11890), where the slow path requiresst_size > 0and, for mesh, a valid container. On the head, a.csotruncated to zero after the cache entry was taken is served as done for the life of the watcher (cached[], cold scan[2]), while deleting the same file is caught by both. That matches the stated goal of not re-reading bytecode, so I read it as a limit to document — butdocs/startup-runtime.md:883says repeated passes "skip verified bytecode without disk queries", and each pass still does a fullos.scandirplus a stat of the marker and the description. A mesh published asps nonewith only.ms57.csonever takes the fast path either (both stages required), so it revalidates its container every pass.4. Timing on ext4
10 000 generated requests / 58 000 files, 5 timed passes per revision, median, both orders:
The cold scan is not measurably faster than
mainhere: the spread between runs exceeds the difference. The warm-cache tick was consistently about half the cold one (163-240 ms against 338-455 ms). The 680 ms → 22 ms in the summary is a Windows/NTFS measurement; I did not reproduce that ratio on ext4, where a per-filegetmtimeis far cheaper.Limits
--watchagainst a real title. The timings come from a shared host with a warm page cache (nodrop_caches) and are noisy enough that I quote ranges.pending_keysonly, nottranslate_requestnor the emitted HLSL.What I would add to the fixture
One test kills all three mutations: populate
completed, rewritereq_<key>.psinnewer than the published manifest and expect the key; withdraw the manifest and expect the key; delete a stage file and expect the key. And if the shim goes, givebrokenacompleted=Noneparameter and assert that an internalTypeErroris not retried.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-26T18:11:07Z.
Thanks @thepatrickworld for the thorough review, differential testing (250 caches x 4 modes), and mutation analysis!
Updated at
d1bf9f74addressing all feedback points:Cache Invalidation & Truncation Checks in
startup_gfx2hlsl_watch_check.py:P1: Descriptionreq_<key>.psinrewritten newer than manifest -> invalidates fromcompleted, re-verified.P2: Published manifest (<key>.txt) withdrawn -> invalidates fromcompleted, re-verified.P3: Bytecode container deleted -> invalidates fromcompleted, re-verified.P4: Bytecode container truncated to zero bytes -> invalidates fromcompleted, re-verified.Removed
try...except TypeErrorshim inwatch_pass:broken(out_dir, skip_failed=False, completed=None)in the fixture to accept the full signature.TypeErrorfallback wrapper inwatch_pass(tools/startup/gfx2hlsl.py), so realtranslate_pendingcalls run directly.TypeErrorraised insidetranslate_pendingis propagated and not swallowed.Fast Path Verification Tightening:
pending_keys, tightened the fast path bytecode check to verifyst_size > 0for non-mesh stages (preventing zero-byte truncated containers from being accepted as completed).ps nonemanifest handling on the fast path so valid single-stage mesh manifests take the completion cache.Documentation Clarification (
docs/startup-runtime.md):--watchpasses skip re-checking and parsing container bytecode from disk when request files and descriptions are unchanged.Filesystem Timing Context:
stat/getmtimequeries per file incur significant syscall overhead in large directories), whereas Linux ext4 with a warm dentry cache already handles directory stats very quickly.Verified clean on Windows:
All passed (29 MD files/545 links checked, 2046 source files clean, all checks passed).
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T06:42:29Z.
Review: COMMENTED
What works
os.scandir()replacement inrequest_keys()andpending_keys()is exactly the right fix — single-pass entry + stat collection eliminates tens of thousands of NTFS metadata queries per pass. This is the single biggest win.completedmap is a smart optimization: by tracking published requests and their.psin/.txtmtimes, it avoids re-reading container bytecode on disk when nothing has changed. The cache invalidation logic correctly checks.psin, manifest.txt, and.vs.cso/.ps.csostages.--skip-failed(-s) andX2W_SKIP_FAILED=1give users control over whether to reprocess known-unsupported requests — useful for incremental development workflows.--jobs/-jCLI flag parallelsX2W_TRANSLATE_JOBSwell, and the ProcessPoolExecutor limit of 61 on Windows is correctly preserved.suppress(ValueError)guards against invalid numeric arguments, and the interval argument scanning (skipping--prefixed args) is robust.Issues
request_keys()scandir scope: The new implementation filtersentry.name.startswith('req_')then relies on the regex to validate the extension. The old code had no pre-filter. This is functionally equivalent but thestartswithcheck could benefit from a comment noting it's intentional (not allreq_*files are ready markers).completeddict threading: Thecompletedparameter is threaded throughwatch_pass()→translate_pending()→pending_keys(). While correct, consider adding# threading completed across watch iterationsas a doc comment at the entry pointwatch_pass()to help future readers understand why this parameter exists.pending_keysearly exit: The new code addsif not keys: returnintranslate_pending(). This is a useful early return, but the original function already iteratedkeysin a loop — this just avoids themin(jobs, len(keys))calculation. Worth noting but not a bug.skip_faileddefault behavior change: The old code hadskip_failed = False(always retry first pass) hardcoded in the--watchbranch. The new code parses--skip-failedfromsys.argv[1:]before the--watchbranch, which means the flag can be placed before or after--watch. This is actually more flexible but the old behavior (always retry first pass) is now gated by a flag rather than implicit first-pass logic. The test covers this correctly but users upgrading might notice different default behavior.request_keys()early return: The newtry/except OSErrorreturnsNone(implicit) instead of[]. This is fine sincerequest_keysis a generator, but the comment should note thatOSErrorduring scandir means "no requests" rather than "error encountered."Recommendations
cache_statscounter (hits vs. misses incompleted) to the--pendingscan output when--verboseor--debugis passed. This would help users quantify the caching impact on their setup.touch()helper in tests creates files with specific mtimes. Consider normalizing these withos.utime()after creation for cross-platform reliability (some Windows filesystems have lower mtime resolution).X2W_SKIP_FAILED=1as a useful environment variable in a startup FAQ section — developers working with large refusal sets will want to know about this.Overall
This is a valuable performance optimization that directly addresses a real bottleneck. The
os.scandir()migration is the right first step, and thecompletedin-memory cache adds another significant improvement. The test coverage for cache invalidation is comprehensive. The CLI changes are well-structured and follow the project's patterns.Recommendation: APPROVE — minor nits above, but this is a solid optimization.
Comments on specific code
request_keys(): clean change,is_file()prefilter is correct.watch_pass(): thecompletedparameter threading is clear.translate_pending(): early return whenkeysis empty is a reasonable optimization.pending_keys(): the three-phase structure (scandir → files dict → req_items scan) is logical and well-structured.main(): CLI argument parsing correctly handles--jobs,-j,--skip-failed,-s, andX2W_SKIP_FAILED.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T06:59:06Z.
Review: CHANGES_REQUESTED
Two regressions reproduce on
d1bf9f74integrated withmainc09145a7.mesh57_resume_controls(), populatedcompletedwith a complete pair, and truncated one byte from.ps57.cso.pending_keys(dir, False, completed)returned[], while a fresh scan returned[0x57]. The existing truncation controls only exercise the fresh path. Please invalidate warm results on changed stage metadata and rerun the full slot-57 completeness check, including the mesh-onlyps nonecase. Add a warm-cache truncation control.gfx2hlsl.py --watch DIR --jobs 4callstranslate_pendingwithoutjobsand sleeps for4.0seconds. I reproduced both by observing the arguments of one watch pass. The option value is being read as the interval, and the parsed worker count never reacheswatch_pass. Please parse the interval separately from the option values, pass the worker limit to watch mode too, and add a CLI control for that path.Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-27T07:31:29Z.
Independent result on
d1bf9f74: the cached slot-57 verdict accepts 12 container states the full scan rejects, and the check that closes it costs the scan it was meant to avoidNot a code change; measurements on a checkout of this head, nothing pushed. Both points of the 06:59 review reproduce here; what follows is only what they do not cover — the width of the first one, what closing it costs, and one argument path that is still open.
Environment
Linux 7.0.0-38, Python 3.11.16, 2 vCPU. No GPU and no Windows in the loop:
tools/startup/gfx2hlsl.pyimports on its own. Headd1bf9f74,gfx2hlsl.pysha256cec19b0832306e0324fdaba41c8c445165a6b046b747478ec4d89f97f7f56f96. Base isorigin/mainc09145a7, taken withgit show origin/main:tools/startup/gfx2hlsl.pyand loaded as a second module, so base, head-fresh and head-warm read the same directory.The cached verdict is wider than the truncation
Method: build a published request, fill
completedwith one full pass, mutate one file, then comparepending_keys(dir, False, completed=<copy of the cache>)(warm) withpending_keys(dir, False)(fresh) and with the base module (no cache, nocompleted).[]means "nothing pending", i.e. the cache treats the result as done. Rows are the slot-57 pair (req_<k>.m57,<k>.ms57.txt,<k>.ms57.cso,<k>.ps57.cso, 48-byte DXContainer envelope), key0x57; theps nonerows keep the manifest line and drop.ps57.cso..ps57.csotruncated by one byte[][0x57][0x57].ps57.csozero bytes[][0x57][0x57].ms57.csotruncated by one byte[][0x57][0x57].ms57.csozero bytes[][0x57][0x57].ps57.csobad header, same size[][0x57][0x57].ms57.csobad header, same size[][0x57][0x57].ps57.csoparts= 0, same size[][0x57][0x57].ps57.csoone extra trailing byte[][0x57][0x57].ps57.csopartsbeyond the container[][0x57][0x57]ps none,.ms57.csotruncated[][0x57][0x57]ps none,.ms57.csozero bytes[][0x57][0x57]ps none,.ms57.csobad header[][0x57][0x57][][0x57][0x57]Controls on the same directory: complete pair, manifest withdrawn, marker rewritten — warm, fresh and base agree on all three. Base equals fresh on every row, so the divergence is the cache alone and not a change of the predicate.
The mechanism is one asymmetry: the fresh branch tests completeness (
has_complete_mesh57_bytecode,:11934and:11936) while the warm branch tests presence (:11890,:11892). The non-mesh branch compares sizes (> 0) on both paths, which is why a one-byte truncation of a.vs.cso/.ps.csois invisible to warm, fresh and base — a truncation control for the pixel path would pin nothing.One more, separate: the cache entry does not carry the dependency record, so a
.psdepappearing next to a cached result is not re-read (warm[], fresh[2]). I could not reach that state through the writer —record_dependencyruns only whenrequest_ps_inputsreturned masks (:11489-11490) and a record whose description is gone is refused (:11485-11486). It is reachable by restoring files, not by the translator.What closing it costs
2000 published slot-57 pairs, 20 samples per variant, four interleaved rounds, medians of 40:
has_complete_mesh57_bytecodein both warm branches (2 lines, cache entry unchanged)At 200 pairs the order holds (2.0 / 9.7 / 4.0 ms against a 9.6 ms scan).
So the minimal fix that makes the cached verdict agree with the fresh one removes the saving entirely: it costs the scan it was meant to avoid. That is not an argument against making the cache correct — it is the price of re-reading every container on every pass, and it may be the right price. The size/mtime variant keeps about twice the delivered speed and flips 12 of these 13 rows; what it leaves is the row that preserves size and mtime, plus the
.psdeprow.Either way
tests/startup_gfx2hlsl_watch_check.py:8-9has to move with the code: it states "An in-memory completed cache skips published requests without re-checking container bytecode on disk", which is exactly the behaviour under review.The control I would add
Smallest one I could make bite: publish a complete slot-57 pair, run one pass with a
completeddict, truncate one.cso, expect the key back. On this head warm returns[]where fresh returns[0x57]; with the two-line fix warm returns[0x57]. The delivered fixture passes on both trees, so it cannot tell them apart: everycompleted=control it has uses key2, a vertex+pixel pair (:82-116), andmesh57_resume_controls()(:187) does test truncation and a bad header but callsscan()(:42), which never passes a cache.Where the worker count still does not arrive
--watch D --jobs 4: one pass receivesjobs=Noneand the sleep is4.0— the count is read as the interval. The pass is called withcompleted=and nojobs(:11767), andwatch_passhas no such parameter.--watch D --jobs=4: the interval stays2.0(the argument begins with-),jobsis parsed to 4 at:11735-11737, and it still does not reach the pass.X2W_TRANSLATE_JOBS=3does reach it: withjobs=None,translate_pendingfalls back totranslation_jobs(), which reports 3. The flag is the only route that is broken.--jobs 4 --watch Dnever enters watch mode:out_dir = sys.argv[2](:11696) becomes the string4, the dispatch at:11742misses, and a one-shot translation runs in a directory named4. That dispatch predates this PR — the same command onorigin/mainalso runs one-shot into4— so the new flag only makes a command line that could not be typed before silently wrong. Parsing the verb instead of indexingsys.argv[1]would fix both orders, but it is not a blocker here.Limits
One host, one process without an adapter. The corpus is synthetic (identical 48-byte envelopes, empty markers), so the absolute milliseconds are a floor for a real cache of translated shaders: the ratio between the shapes is the part that travels. The timing ran on Linux, where
DirEntry.stat()on a stage is a syscall; on Windows those entries come from the directory scan, so a size/mtime variant should cost less there — I did not measure it, this run had no Windows host. The 13 rows are mutations I could build, not an exhaustive partition of malformed containers, and the two fix shapes are modules applied in a worktree, not proposed branches.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-27T08:53:19Z.
Addressed review feedback and verified on commit
c445bf11(rebased onupstream/mainat0e704468):1. Warm Slot-57 Container Invalidation (@R0Y00, @thepatrickworld)
pending_keys(),completed[key]now records stage metadata:(saved_req_mtime, saved_base, saved_psin_mtime, stage_meta)wherestage_meta = [(s, files[s].stat().st_size, files[s].stat().st_mtime) for s in stages].st_sizeandst_mtime. If any stage file is truncated, deleted, or re-written, the warm entry is invalidated and falls through to the full verification pipeline (has_complete_mesh57_bytecode(), preserving the mesh-onlyps nonecase).tests/startup_gfx2hlsl_watch_check.pyto clarify that the warm cache verifies stage metadata against disk stats rather than bypassing container checks entirely.mesh57_resume_controls()intests/startup_gfx2hlsl_watch_check.pywith warm-cache truncation controls:.ps57.csowith an activecompletedcache returns[0x57]..ms57.csowith an activecompletedcache returns[0x57].ps nonecontainers with an activecompletedcache.2.
--watch DIR --jobs NInterval and Worker Concurrency (@R0Y00, @thepatrickworld)main()so that option arguments (--jobs N,-j N) are explicitly recognized and their values are not treated as the sleep interval. The interval defaults to2.0unless a numeric positional argument is provided.jobs=Noneparameter towatch_pass()and forwardedjobs=jobstotranslate_pending().tests/startup_gfx2hlsl_watch_check.pycovering:--watch <dir> --jobs 4(worker count 4 passed towatch_pass, default interval 2.0s)--watch <dir> 3.5 --jobs 4(worker count 4 passed towatch_pass, custom interval 3.5s)--watch <dir> --jobs=4--watch <dir> -j 43. Explanatory Comments (@KelboLive)
request_keys()clarifying theentry.name.startswith('req_')pre-filter andOSErrorreturn behavior.# threading completed across watch iterationsinwatch_pass().Test Verification
All passed with 0 failures on Windows 11 / Python 3.14.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T09:01:21Z.
Review: CHANGES_REQUESTED
The two earlier findings are fixed at
c445bf11. On currentmain3e9542a6plus this PR, I reran the watch suite (including the warm slot-57 truncation and interval/worker controls), translator, cache rekey, capture and refusal suites. All five pass.One Windows CLI edge remains. With a directory of 62 synthetic pending RTV markers,
gfx2hlsl.py --pending DIR --jobs 62exits 1 before translating anything withValueError: max_workers must be <= 61.X2W_TRANSLATE_JOBS=62already caps to 61, but the explicit argument bypassestranslation_jobs(). Please route both through the same Windows worker limit, with a control that distinguishes the explicit and environment forms. This also covers watch mode now that it forwardsjobs.Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-27T09:14:29Z.
Addressed in commit
cf544ede(rebased onupstream/mainate446b072):Windows Worker Limit on Explicit
--jobs(@R0Y00)translation_jobs(jobs=None)now accepts an optional explicit worker limit. Both the explicit argument and theX2W_TRANSLATE_JOBSenvironment variable route through the same logic:translate_pending(), worker count resolution is updated tojobs = min(translation_jobs(jobs), len(keys)), ensuring that--pending ... --jobs 62and--watch ... --jobs 62never exceed 61 workers on Windows.tests/startup_gfx2hlsl_watch_check.pydistinguishing the explicit and environment forms:translation_jobs(62)returns 61 on Windows.X2W_TRANSLATE_JOBS=62returns 61 on Windows.jobsargument overridesX2W_TRANSLATE_JOBSsetting.translate_pendingwith explicitjobs=62(capped to 61).translate_pendingwithX2W_TRANSLATE_JOBS=62(capped to 61).watch_passforwarding explicitjobs=62(capped to 61).--pending DIR --jobs 62andX2W_TRANSLATE_JOBS=62exiting 0 without raisingValueError.Test Verification
All passed with 0 failures on Windows 11 / Python 3.14.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T10:14:51Z.
Review: APPROVED
The Windows worker-limit finding is resolved at
cf544ede. I reviewed the shared worker normalization and re-ran the source-built checks on Windows 11 26200.9974 with Python 3.12, integrating this head withmainthrough #2910 (local treef38e423d).startup_gfx2hlsl_watch_check.py,startup_translator_check.py,startup_shader_cache_rekey_check.py,startup_gfx2hlsl_capture_check.py,startup_gfx2hlsl_refusals_check.pyandstartup_gfx2hlsl_load_desc_check.pyall exited zero. The watch fixture exercises--jobs 62through both the Windows pending CLI and the watch setup and keeps requests at or below the supported width. Its injected exceptions emitted their expected diagnostics. The required hosted Windows check passed.Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-27T10:53:27Z.
Post-merge receipt on
98007de5: the cached slot-57 verdict now agrees with the full scan on 13 of the 14 states this harness buildsNot a code change; measurements only. No action requested.
Why this is a delta and not a third report
My comment of 07:31 ended on a prediction about the size/mtime variant: it "flips 12 of these 13 rows; what it leaves is the row that preserves size and mtime, plus the
.psdeprow." On the merged tree the first half holds exactly and the second half does not: the.psdeprow is closed as well. What follows is only that difference, measured on the commit that shipped.Identity of what is measured
98007de5, in a separate worktree.Both print
2fbb07adc75698b96fff430b2a4f858d2c51004ff07cec352ebacaa2573b65f8(pending_keys, signature to end of body, 136 lines). The rest of the file differs by merges that landed in between, so a whole-blob comparison would have been the wrong instrument.python3 -B tests/startup_gfx2hlsl_watch_check.pyprints translator errors raised from its own lambdas (startup_gfx2hlsl_watch_check.py:344) and still ends onstartup_gfx2hlsl_watch_check passed, rc 0.d1bf9f74(gfx2hlsl.pysha256cec19b0832306e0324fdaba41c8c445165a6b046b747478ec4d89f97f7f56f96), same harness, same directory states, same machine. Linux 7.0.0-38-generic, Python 3.11.16; no Windows, no GPU.Method
Unchanged from 07:31: build a published request, fill
completedwith one full pass, mutate one file, then comparepending_keys(dir, False, completed=<copy of the cache>)(warm) withpending_keys(dir, False)(fresh).[]means the cache treats the result as done.Result
d1bf9f7498007de5Thirteen states moved from warm
[]to a pending key:.ps57.csoand.ms57.csotruncated by one byte, both zero-byte stages, a bad header at the same size with a fresh mtime (both stages),parts = 0,partsbeyond the container, one extra trailing byte, and the threeps nonecontainer states — all[0x57]— plus the graph-path state where a.psdeprecord appears, which is[0x2].The row that remains is the one 07:31 named
.ps57.csorewritten with the same byte count and itsst_mtimerestored: warm[], fresh[0x57]. The metadata recorded per published stage is(name, st_size, st_mtime)— written at lines 12806-12808, compared at 12748 — so a rewrite that restores both fields is invisible to the cache, while the same bad header with a fresh mtime is now rejected on both paths. That pair is what isolates the behaviour to the mtime rather than to the size or to the container check.Limits
AI-assisted.