startup: back off the retry for an absent shader cache manifest #2925
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2925"
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 JB2WIN on 2026-11-26T20:55:43Z.
What
The graphics and compute translation paths of the D3D12 stand-in look for an absent shader cache manifest (
<key>.txt) again on a later draw or Dispatch, so a translation published byrun.ps1 -Translateduring the run is picked up. Until now each absent key was looked up again once per second, and each lookup opens a cache file whiledraw_lockis held, the lock that every draw and Dispatch takes.This change makes the retry back off: 1 s after the first miss, doubling with each further miss up to 32 s, reset when the manifest is found. Both paths share
x2w_startup::ManifestRetry(src/startup_stubs/manifest_retry.h). Every place that used the oldretry_manifest_atkeeps its meaning (pending()is the old!= 0, so the first-miss log,translation_missingandpreviously_missingare unchanged).Why
In a local title run with a cache that holds requests for ~850 compute keys, ~630 of them without a translation, a stack-sampling probe of the list-recording threads showed most stand-in time in
record_translated_dispatch→load_compute_translation→read_textand in waiting fordraw_lock. An independent read-only diagnosis from symptom only reached the same cause.How tested
Build:
cmake --preset release,cmake --build out\build\release(0 errors).startup_manifest_retryis new. Withoutmanifest_retry.hit fails to compile (C1083). It checks the delays (1, 2, 4, 8, 16, 32, 32 s, no shift overflow), that a found manifest resets the schedule, and that one key that never appears is looked up 23 times in ten minutes instead of ~600.Local title runs (not reproducible from the repository; same cache, same switches, 240 s, input at 60 s, one run each, NVIDIA GeForce RTX 3080 driver 32.0.16.2124, Windows 11 build 26200, no debug layer):
6ee878d8On a stack with more translated draws the same change took the scene from ~0.4 fps to ~7.8 fps (measured with a fixed 60 s retry probe, not with this exact schedule).
Limits
draw_lock; it is only rarer. Moving the file I/O out of the lock would be a larger change.AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T05:25:41Z.
Review: COMMENTED
PR #2925 by @JB2WIN — startup: back off the retry for an absent shader cache manifest
What works
Issues
Recommendations
Overall
A small, focused PR that addresses a real performance issue. The ManifestRetry struct is well-designed with clean transitions between pending/found states. The test coverage is thorough for the arithmetic. Ready to merge.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T05:28:17Z.
Review: COMMENTED
PR #2925 by @JB2WIN -- startup: back off the retry for an absent shader cache manifest
What works
Issues
Recommendations
Overall
A well-researched, well-tested implementation. The linear layout extension is cleanly separated from tiled modes. Minor concern about BC format handling in linear mode, but the existing refusal behavior is safe. Ready for merge.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T05:44:01Z.
Review: APPROVED
Reviewed
36d82780012e6617b5ca9de00400621047abdb8bin a clean integration tree. The shared state resets after finding a manifest and caps repeated-miss delays at 32 s. On Windows 11 26200.9974 I builtstartup_manifest_retry_check startup_stream_consumer d3d12_xs_shimin Release/O2. Eight CTest entries passed:startup_manifest_retry,startup_shader_cache_key,startup_compute_request_offline, bothstartup_stream_draw_*, bothstartup_compute_dispatch_*, andstartup_compute_root_srv_dispatch_warp. On WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 the stream fixture's first draw stayed clear and the same guest pipeline drew pixels after publishing the manifest. The compute entries matched 320 words. Required Windows CI passed.