Skip to content

GPU: synchronize frame interval resets with tick reservations - #63

Closed
devin-ai-integration[bot] wants to merge 15 commits into
mainfrom
devin/frame-interval-lock
Closed

devin-ai-integration[bot] wants to merge 15 commits into
mainfrom
devin/frame-interval-lock

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

Summary

Ports the implementation part of upstream Marvisak/VIctory#2479.

set_interval now holds the frame-clock mutex while reading the last reserved tick and replacing the clock. Previously a concurrent next_tick could reserve a newer tick between those operations, anchoring the replacement interval to stale time and potentially adding an extra interval to subsequent frame waits.

This is a small frame-pacing correctness fix relevant to stable FPS measurement on the 30 fps target.

Validation:

  • CARGO_FEATURE_PURE=1 RUSTFLAGS='-D warnings' cargo check --locked -p victory-gpu --all-targets --target x86_64-pc-windows-msvc
  • CARGO_FEATURE_PURE=1 RUSTFLAGS='-D warnings' cargo clippy --locked -p victory-gpu --all-targets --all-features --target x86_64-pc-windows-msvc
  • cargo run --locked --quiet --package xtask -- policy

No GPU/Proton runtime validation is available in this VM.


Devin Review

Personed and others added 15 commits November 25, 2026 15:46
Under Wine each GetWriteWatch costs about 1 ms whatever the range
(contention on Wine's virtual-memory lock with the title's write faults).
Allocations are walked once and cached by base, a watched allocation is
asked about whole so the submission's other buffers in it answer from the
journal, and file views (xmem's physical pages) skip the watch question
entirely and go straight to their guards. Region entries drop on remap,
rewrite and failed whole askings.

Re-applied onto the round-2 watch: known_view composes with the mapped
shortcut, guard() takes the known_mapped hint as in the original port.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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>
writes never marked the allocation as covered, so even disjoint buffers
in one watched allocation repeated the whole scan once a flush each —
under Wine, about 1 ms a scan. The covered range joins the submission's
ahead askings; the coverage ends with the submission as the batch's does.

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

An entry the region walk did not complete no longer types unverified
pages as file views; a write into the middle of an allocation drops its
entry (not only one at the base); and the mapped shortcut honors
VICTORY_VIEW_ASK/VICTORY_GUARD_ASK like the guards' own fast paths.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Two corrections to the coverage registration: the narrow retry's answer
covers only the range asked, so a failed whole scan followed by a good
narrow one no longer claims the allocation; and the entry is registered
only while a submission's batch asking stands, because outside one
nothing ends it — a heap created there would otherwise answer from a
stale snapshot for the rest of the run.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
GPU: skip pipeline demand for empty compute dispatches
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Fechando manualmente: a mesma correção já entrou na main no merge commit fe3b887 durante a instabilidade da API do GitHub; o rebase posterior 139d965 ficou redundante.

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