d3d12: uncap rendering and use measured simulation steps (D3D12-UNCAPPED-SIMULATION) #3204
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3204"
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 ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-12-02T19:09:26Z.
Claimed as D3D12-UNCAPPED-SIMULATION.
What and why
NONEin F1 or F4 makes runtime frame events immediate, and numeric caps still apply live.LEONIDA_SIM_MAX_STEP_MScan adjust it.2694497e8.Tested
GPUs tested — Windows 11 Pro, Radeon RX 6800 system with AMD driver 32.0.21030.2001. Adapter selection was automatic.
AI-assisted — Codex GPT-6.2 Sol for implementation, read-only timing investigation, and a separate read-only code review. The reviewer verified the limiter branch, both timer floors and the clean-room diff.
Checklist
main.Imported from ubiquitarianism/leonida. Originally posted by x2Tweek on 2026-12-02T20:15:31Z.
Game run on a large machine, Series X profile at 4K: standing still, the 30 fps ceiling is gone.
Setup: RTX 5090 32 GB, driver 621.40, i9-14900KS, 64 GB DDR5, Windows 11 (26300). Base: upstream main
0d7a451abplus #3113 and #3182, diag build. This PR merged on top atpr-3204. Series X profile, 3840x2160output, render scale 0.6667, the title's upscaler, hardware ray tracing (
-HardwareRT -SmoothMotion -PrecompileAll -Log),LEONIDA_FPS_CAP=0, fullscreen.Tests:
cargo test -p leonida-loadergives 94 passed and 0 failed. The log hashook applied what="frame pacing: leave the wait to the runtime's frame events"andframe pacing and measured simulation steps places=4.as in the base runs, so take the exact figure loosely; the base sat at the 30 fps line on every standing run.
above the title's deadline, so there was no wait to remove.
AI-assisted: the build, the test run, the log reading and the write-up were done with Claude Opus 5.5 (Claude
Code); the numbers are the runtime's own log lines, and the simulation-speed observation is the player's.
Imported from ubiquitarianism/leonida. Originally posted by icdmkg2 on 2026-12-02T20:23:42Z.
Third-party Windows (NVIDIA) verification of #3204 (
D3D12-UNCAPPED-SIMULATION) on headab3bf6eceab3bf6eceeb3f87807f71a0fd42872d503a0a208merged cleanly (git merge --no-ff) ontoorigin/mainb41763227.621.24(32.0.16.2124), AMD Ryzen 7 H 260 w/ Radeon 780M, 32 GB RAM, Windows 1110.0.26300.9974,rustc 1.98.1.Results (MEASURED)
python -I scripts/check_no_game_data.py(all 5 touched files)0python -I tools/d3d12_switches.py --check d3d12/docs/switches.md0python -m unittest discover -s tests -p "test_docs_*.py"57/57OKLEONIDA_ADAPTER=5060python -I scripts/red_green.py 3204 --mutate856passed,0failed acrossleonida-gpuandleonida-loader(0 descriptor test failures on RTX 5060); red:verdict: red does not build(cannot find function measured_frame_timing_patches in this scope, expected for the new loader helper)LEONIDA_ADAPTER=5060cargo test -p leonida-gpu --features diagnostics --locked --lib -- frame::1 passed, 0 failed(frame::tests::waits_end_on_ticks_and_count_frames)cargo test -p leonida-loader --locked94 passed, 0 failed(91unit +2load_probe+1title_dlls, includingmeasured_steps_and_the_title_wait_are_patched_together)Review notes (READ IN CODE)
frame.rs:CAP_NONE(-1) cleanly separates uncapped (Duration::ZERO, immediateS_OKeven ontimeout_ms == 0polls) fromCAP_UNREAD(-2) and title-interval (0); switching back to capped (set_cap("")) resetsc.first = last_tick()under the clock lock so subsequent ticks remain monotonic.hooks.rs:apply_allpre-checks all bytes and restoresVirtualProtectflags in reverse order if any page protection call fails, avoiding partial patch application on shared pages.AI-assisted: Gemini 4 Neon (High) via Antigravity (test execution, diff review, and write-up).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T21:22:44Z.
VERIFY-3204 — Windows nativo: el test nuevo muerde, y el cambio arregla una discrepancia que ya existía
(this PR)b41763227= currentmainmain— cleanRan
The one failure is this machine's, unchanged all day:
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in(the iGPU artefact ofD3D12CreateDevice(None, ..)that #2995 addresses).Negative control (synthetic): I put the old
Some(0) => 500back, rebuilt and ran →FAILED: waits_end_on_ticks_and_count_frames,assertion left == right failedatframe.rs:326. The test bites on exactly the semantics this PR changes.What I checked around the change, because
0is a live switch0"Unlimited":host/trainer.rshas its owncap_of(Some(0) => Cap::Unlimited) andcap_textwrites"0"forCap::Unlimited, whileframe.rsonmaintreated0as a 500 µs tick. This PR is what makes the clock agree with the menu — the change is not redefining "0" arbitrarily, it is fixing a mismatch that was already there.CAP_UNREAD/CAP_NONEare distinct now (-2/-1): previously-1meant both "not read yet" and "the title's". Splitting them is what lets0mean "no interval" instead of borrowing-1.What I would watch, and cannot test
Duration::ZEROis now what an uncapped frame waits: no pacing at all, so the cost moves to the CPU (a busy loop if the title's own sync does not block). The README anddocs/vi_patch.mdare updated, but whether an uncapped run burns a core is a run, not a unit test.0as "fast but paced" now get "unpaced": that is the point of the PR, and it is a behaviour change for anyone who set it — worth a line in the body's "what changes for you", if it is not there already.Written with an AI assistant.