d3d12: texture frame ceiling follow-ups from #3291's review (D3D12-TEXTURE-FRAME-FOLLOWUPS) #3482
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
3 participants
Due date
No due date set.
Reference
leonida/mandy!3482
Loading…
Reference in a new issue
No description provided.
Delete branch "oreofr/texture-frame-followups"
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?
Pull request successfully merged and closed
Item: D3D12-TEXTURE-FRAME-FOLLOWUPS (claimed in #3312: https://git.leonida.now/leonida/mandy/issues/3312#issuecomment-26254)
Depends on: none (#3291 is merged,
00e245be5)The four follow-ups the review of #3291 asked for, all in
d3d12/crates/leonida-gpu/src/draw.rs.Off by default, no change for players: every change sits inside
LEONIDA_TEXTURE_FRAME_MS. With it unset (the default) the code paths are the same as before.LAST_ON_TIMEis read only when the ceiling is on, so the change to its writer only matters then.What each fix does
pass_ask_us), so passes running at once share it. Once its slice is spent, at a slot boundary, it asks again for what the frame has left (FrameTime::extend, throughFrameTimeGuard::more), bounded by its own time (LEONIDA_TEXTURE_STAGE_MS) in all. Before, a frame with one texture pass got 4 ms of an 8 ms ceiling. A pass whose frame has ended gets nothing more.slice_floor_us),reserveandextendgive nothing, unless the pass asked for less than that. The pass then skips the queue's scan and sort instead of sorting the whole queue for a few µs. A refusal takes nothing from the frame.LAST_ON_TIMEpicks the catch-up ceiling (3x). It is now written only whenPASS_BUDGETisNone(note_on_time). Before, a bake pass that looked at up to1 << 16slots could give the ordinary passes after it three times the ceiling.FrameTime's comment no longer says "at most one slot". A pass past its slice is charged for the slot it was in and for its queue's preparation: that time counts from the reservation on but is not checked against the slice.texture_frame_ms's comment covers the re-ask and the floor. It no longer namesLEONIDA_TEXTURE_STAGE_MS, which now has its own comment where it is read.d3d12/docs/switches.mdis regenerated.LEONIDA_TEXTURE_STAGE_MS's line now gives that switch's own text instead of the frame ceiling's.Tests (RTX 4070 Laptop, Windows 11; unit tests only, no game run)
Three new tests in
draw::texture_frame_tests. To get red/green, the helpers (pass_ask_us,slice_floor_us,note_on_time,FrameTime::extend, thereservefloor argument) were first added with main's behaviour (no re-ask, no floor, an unconditional store), then fixed:a_lone_pass_asks_again_for_the_rest_of_the_frame(1)a_crumb_of_the_ceiling_counts_as_spent(2)only_plain_passes_note_the_backlog(3)cargo test -p leonida-gpu: 790 passed, 0 failed, 60 ignoredcargo clippy -p leonida-gpu --all-targets -- -D warnings: cleanpython -I tools/d3d12_switches.py --out d3d12/docs/switches.md, then--check d3d12/docs/switches.md: exit 0. The only change is theLEONIDA_TEXTURE_STAGE_MSline.python -I tests/test_d3d12_switches.py: 22 tests OKpython -I scripts/check_no_game_data.pyon both changed files: exit 0AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
RUN — In-game (
LEONIDA_TEXTURE_FRAME_MS=2) & Unit Test Gate (NVIDIA RTX 5070 12 GB, Windows 11)Tested PR head
fe9a7e7ce6fast-forwarded cleanly ontomain(00e245be5), diagnostic release build (-SeriesS, no frame generation,LEONIDA_TEXTURE_FRAME_MS=2to exercise all four follow-up code paths live, 315 s automated run from the same save), compared against our recentmain(30c683055) baseline:mainbaseline (30c683055, default)#3482(fe9a7e7ce6,LEONIDA_TEXTURE_FRAME_MS=2)>=1000draws)36(max_draws=5187)38(max_draws=5322)23.0 fps(43.5 ms)23.5 fps(42.6 ms)13.7/25.0 fps13.6/24.1 fps3000-4999draws/frame median23.2 fps(28samples)23.5 fps(27samples)0/0/00/0/0Unit & Repo Checks
cargo test -p leonida-gpu --lib --locked draw::—36/36PASS (3ignored; alldraw::texture_frame_tests::pass includinga_lone_pass_asks_again_for_the_rest_of_the_frameandonly_plain_passes_note_the_backlog)cargo clippy -p leonida-gpu --all-targets --locked -- -D warnings—0warningspython -I tools/d3d12_switches.py --check d3d12/docs/switches.md— PASSpython -I scripts/check_no_game_data.py— PASSVerdict
PASS — clean fast-forward on
00e245be5, all36/36draw::tests andclippy/switch checks pass, and the 315 s live run withLEONIDA_TEXTURE_FRAME_MS=2completed cleanly with zero errors and no FPS regression. Ready for merge.AI-assisted.
Merged by Moon's agent on Moon's written authorization. A separate reviewer (Claude Opus 5.5) ACCEPTED the four follow-ups of #3291: re-ask for the rest of the ceiling, 1/8 floor, LAST_ON_TIME only without PASS_BUDGET, docs fixed;
cargo test -p leonida-gpu --locked790 passed atfe9a7e7ce. Off by default.