Skip to content

gpu: review follow-ups: cache-write fallback, warm-up mesh mode + deadline - #61

Merged
devin-ai-integration[bot] merged 3 commits into
mainfrom
devin/cache-write-fix
Nov 25, 2026
Merged

devin-ai-integration[bot] merged 3 commits into
mainfrom
devin/cache-write-fix

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Three small follow-ups escalated from the round-2 review (#55), each its own commit:

  1. A failed cache write no longer drops the translated shader — the disk error path returned the translation as an error, and Shader::translated remembers failures for the rest of the run: a full or read-only cache directory cost every draw of the program. The shader is now returned uncached.
  2. Warm-up uses the host's mesh mode — it wrote only native-mesh cache entries while emulation hardware (the RX 580 target) keys by the emulation mode, so mesh programs still translated on first use there.
  3. Warm-up stops scanning past the deadline — once VICTORY_WARM_SECONDS expires the walk stops opening assets instead of scanning every remaining one for workers that break out at once.

Test plan

  • shader_cache tests 10/10 locally; clippy -D warnings clean

Link to Devin session: https://app.devin.ai/sessions/39a24dfe2c184165b42b2108a96286b6
Open in Devin Desktop: https://app.devin.ai/desktop/session/39a24dfe2c184165b42b2108a96286b6?variant=devin
Requested by: @Personed


👀 Devin fixed 3 findings · 1 finding for you to triage · Follow Devin's work

Devin Review

Personed and others added 3 commits November 25, 2026 15:47
The disk error path returned the translation as an error, and
Shader::translated remembers failures for the rest of the run: a full or
read-only cache directory cost every draw of the program. The shader is
now returned uncached (the same work the converter just did).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…dline

Warm-up wrote only native-mesh cache entries while emulation hardware
keys by the emulation mode, so mesh programs still translated on first
use there. The mode now follows the machine's mesh support. And once
VICTORY_WARM_SECONDS expires, the walk stops opening assets instead of
scanning every remaining one for workers that break out at once.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ne first

Only a mesh program's container keys by the mesh mode at runtime: warming
every container in the emulation mode on emulation hardware left vertex,
pixel and compute shaders uncached there. The mode now follows the
container's own stage. Warm-up also probes the view-index cap as runtime
translation does, and the deadline check leads the entry loop so later
roots are not walked for nothing.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 4 findings. Devin fixed 3 findings; 1 finding is left for you to triage below.

Fixed by Devin (3)
  • Warm-up still needs the view limit — Fixed: warm now probes the view-index cap before translating, as runtime translation does.
  • Asset traversal continues past deadline — Fixed: the deadline check now leads the entry loop, so later roots are not walked.
  • Warm-up cache misses for non-mesh shaders — Fixed: the warm-up mesh mode now follows the container's own stage — only mesh programs key Emulate, vertex/pixel/compute stay Native as the runtime keys them.

View findings in Devin Review · Follow Devin's work

Devin Review

let ran = AtomicBool::new(false);
// The mode the runtime translates with on this machine: an emulated
// mesh shader's cache entry is another key than the native one's, so a
// warm-up in only the native mode left emulation hardware (no mesh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🟡 Ignored warm-up wave size override

When warm targets a different wave size, host creation overwrites VICTORY_HOST_WAVE with the local GPU’s value. The target run then misses the warmed entries.

Devin left this for you to triage: Cross-machine warm-up (warming for a different GPU's wave size) is inherently approximate: the cache key includes the local build fingerprint either way. Same-machine warm-up — the documented flow — is unaffected. Recommend documenting the limitation rather than plumbing target overrides.

Learn more

The warm-up CLI exposes VICTORY_HOST_WAVE so users can match the intended runtime host. The Translate command sets it before starting warm-up. The first host() call initializes the runtime device, whose feature query replaces that same value. The translation fingerprint keys every entry on the resulting wave size.

Example: Set VICTORY_HOST_WAVE=32 on a machine whose device reports 64 lanes, with other cache-key settings matched to the intended run. The warm-up writes entries for 64 lanes, so the 32-lane run translates them again.

Recommended fix: Resolve host capabilities once before spawning workers and apply the explicit warm-up wave override after probing, before building any cache keys. Keep the runtime's hardware-derived setting unchanged.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant