GPU: honour scheduled frame-event offsets #321
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!321
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-321"
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?
@Quat3rnion on GitHub · 2026-11-24 02:16 UTC · original
Quat3rnion:victory-frame-offsets→main· +82 −16 · 1 files · 2 commits · openWhat
Frame events were treated as happening exactly on the tick:
schedule()discarded the offset the title supplied. This stores the offset per event
kind (origin, vblank, flip) and places each wait at that point within the
next free tick. Offsets of a whole tick or more move the event into a later
tick, and the once-per-tick rule still applies. This is part of the plan's
frame-pacing work for the world path.
It overlaps the
next_tickarea touched by PR #174, which fixes a separaterace in the same function. The two should be reconciled before merging.
An AI tool wrote part of this change.
Tested
cargo test --workspacewith PR #112's Linux build fix applied locally (not part of this PR): 166 passed, 0 failed, 3 ignored. Three frame tests cover offsets within and across ticks and the scheduling call.cargo check --target x86_64-pc-windows-gnu --workspace --testspasses. No Windows host here.cargo xtask policypasses (150 files ok). No game files or data from them were added.Checklist
cargo xtask policypasses. No game files or data from them were added.@r4tedx on GitHub · 2026-11-24 03:30 UTC · original
Review note with a small repro (built on
maind2a4bae). With a 1 ms period and a 0.3 ms offset, asking for the next event at 1.1 ms returns(2, 1200000): the event of tick 2, 1.2 ms away. The event of tick 1 at 1.3 ms is still ahead at that moment (0.2 ms away) and is skipped; I expected(1, 200000). It looks likeevent_afteradvances to the next tick before considering the current tick's offset.mainhas no offset handling at all, so this is not a regression, but a title pacing itself by these events would miss one event per period whenever it asks between a tick and that tick's offset.From a synthetic test only; I have no copy of the title.
@Quat3rnion on GitHub · 2026-11-24 07:30 UTC · original
Rebased on current main. Fixed event_after so a pending event in the current tick is no longer skipped: it steps to the next tick only once the offset instant has passed. Added your 1.1 ms / 0.3 ms case as a regression. New head 3ff5566.
@akimfomin on GitHub · 2026-11-24 11:53 UTC · original · edited 2026-11-24 14:40 UTC
PortBridge linked this work to Continued #402. I ran the three existing
frame.rstests from3ff5566in a standalone native Windows harness (Rust 1.100.0). All three passed.I also replayed r4tedx’s case through the Continued
FramePaceratd743662: period 1,000 µs, call at 1,100 µs, offset 300 µs. It was pending at 1,299 µs and returned token 1 at 1,300 µs, matching the corrected VIctory timing. Continued rejects an offset of a full period, while #321 carries offsets across ticks. The sub-period case is a shared regression the teams can compare. This is a synthetic timing check. AI-assisted with Codex._Originally posted by @akimfomin in #321
Follow-up on combining #321 with #174. I tested Quat3rnion's scheduling at
d674d9e2together with AndyLatimer's tick reservation at882664e1. A three-way merge fromd2a4baegives two conflicts innext_tick. The resolution keepsevent_afterand reserves its chosen tick under the existing clock lock only when the delay fits the timeout.All five standalone
frame.rstests passed on native Windows with Rust 1.100.0, in 40 runs with default test threading and 20 with four threads. At elapsed 11 s with a 10 s period and a 3 s offset, a zero-timeout call leaves tick 101 pending. Two eligible waits then reserve 101 and 102. Removing either the offset or the reservation breaks that test. The tests that modify shared state use a test-only lock. This is a synthetic CPU module check.Core of the checked change against
d674d9e2PortBridge case PB-0008. AI-assisted with Codex.
@Marvisak on GitHub · 2026-11-25 00:31 UTC · original · edited 2026-11-25 01:15 UTC
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-gpu/src/frame.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.