play: DARNER_SIM_STEP_MAX, raise the title's 1/15 s simulation step cap #323
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!323
Loading…
Reference in a new issue
No description provided.
Delete branch "dnzarc/Darner:sim-step-cap"
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?
What
A new opt-in switch,
DARNER_SIM_STEP_MAX=<seconds>(0.05 to 1, off by default),raises the ceiling the title's simulation puts on one frame's step, which is a float
of 1/15 s in the image. At load, before any title code runs, the two constants there
are checked and the cap is written; another image, or a different pair of values,
is refused with a line saying so.
Why
The title clamps each frame's timers to at most 1/15 s (
darner-loader'sframe_rate.rsalready documents this at+0x2226040). Below 15 fps game timetherefore falls behind the wall clock:
On a 6 GB laptop this layer runs 10-16 fps, so the game is in slow motion most of
the time: the character walks slower when fps dips and normal when it recovers. That
reads as "not smooth" even when the frame rate itself is steady. Issue #296 describes
it and asks for exactly this switch; Foxhound's Foxpatch (by Mahmoud247) raises the
same float, and this makes it a switch instead of a patch on the file.
Tested
RTX 4050 Laptop 6 GB (5,920 MB), i5-12450HX, 23.8 GB RAM, driver 621.24, Windows 11.
v2026.12.03.02 plus this commit, Series S at 960x540, DLSS performance, frame
generation off, texture quality medium,
DARNER_THIN_HEAP_ORDER=0:simulation step: cap 0.0667 s -> 0.2000 sI did not measure how it feels at 5 fps or with driving at speed; the bigger step per
frame is the trade-off, which is why it is off by default.
Diff
crates/darner-loader/src/frame_rate.rs: the constants,asked_sim_step_max()(parsing and the 0.05..1 range), and
patch_sim_step()(verification, one page madewritable, the old protection restored).
apps/darner/src/run.rs: the call, next to the frame-rate sites, before the title runs.README.md: the row, with the table above in short.Fluxer ID: 1577761092279480320
Independent Windows build, gate, and code-read review of head
eccc9116ad2228e3d8b1df2597026fa4ed9d185d, based onmainf3840d73d3504c30218debfbc8795b9225447317. Not run in-game.Environment
x86_64-pc-windows-msvc), MSVC 19.44.35230.Measured results
cargo clippy --workspace --all-targets --locked -- -D warnings): PASS.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings): PASS.cargo xtask policy: PASS (asset policy: 555 files ok).cargo test --locked -p darner-loader --lib frame_rate::tests::: PASS (4 passed; 0 failed; 0 ignored; 88 filtered out).cargo test --locked -p darner --bin darner: PASS (148 passed; 0 failed; 1 ignored).cargo doc --locked -p darner-loader --no-deps: completed; emitted three warnings in unchangedcrash.rs,heap_sites.rs, andscenes.rs.Code-read audit
asked_sim_step_maxcorrectly rejects non-finite/out-of-range values and leaves the stock cap unchanged when unset (crates/darner-loader/src/frame_rate.rs:292-299).patch_sim_stepbounds-checks the RVA and verifies the adjacent stock cap/floor before writing (frame_rate.rs:312-321); the call runs only for--execute, beforespawn_main(apps/darner/src/run.rs:912-918,:963-964).runexplicitly continues with unknown images (apps/darner/src/run.rs:498-515), and the new call does not usebuild;patch_sim_stepidentifies its target only by two adjacent 32-bit values at one offset (frame_rate.rs:318-321). Require a recognized target build or a stronger image-specific signature before writing, so an unknown executable with those values at that RVA cannot be patched as if it were the supported title.patch_sim_stepdiscards the result of restoring the prior protection (frame_rate.rs:327-334), thenrunreports a successful patch (apps/darner/src/run.rs:917). If restoration fails, the image page remains writable with no warning; report that failure rather than treating the operation as fully successful.README.md:725), while a 1/15 s cap yields about 93% and 40%, respectively. The module comment's 13-fps figure is about 87%, but its 6-fps figure is also 45% (frame_rate.rs:280-283). The prior interval doc comment also hasrounded///joined on one line (frame_rate.rs:78).Verdict: CHANGES NEEDED.
AI-assisted: yes (GitHub Copilot, Auto mode).
Thanks for the review. Head is now
7086756on sim-step-cap (on top ofeccc9116); all four points are in:Ran here: gate 1 (cargo clippy --workspace --all-targets --locked -- -D warnings) PASS; cargo test -p darner-loader --lib frame_rate: 6 passed; cargo test -p darner --bin darner: 148 passed, 1 ignored. Gate 2 (--all-features) was not run on this host. No game run after these changes: they only touch the start path, and the call site behaves as before for the known build.
Code review only (read the diff at
7086756), nothing built or run. The fixes for the earlier review look right: build check, protection error, numbers, tests. Three more:+0x6159EC0the cap's own variable, or a pooled float literal? MSVC shares identical float constants (__real@3d888889) and lays them out by value, so 1/15 next to 0.001 may be two neighbouring pooled literals. If anything else in the title loads that address, it gets the new value too. The existing patches inframe_rate.rschange code sites (Site,Kind::Load), not literals. If the address has more than one reference, patching the load at the clamp (+0x2226040) the same way would keep the change to the clamp alone.run.rs: the}closingif !executeanddarner_loader::report_crashes();ended up on one line. That is a stray reformat of a line the change doesn't need.SIM_STEP_CAP + 16bytes) to touch 8. Offsettingbaseback bySIM_STEP_CAPover a 16-byte buffer tests the same thing.Reviewed with Claude Code (AI-assisted); findings checked by a human before posting.
Head is now
f89ffa0. You were right about the literal: a scan of every RIP-relativemovss/vmovssin the code sections finds 65 loads of the 1/15 at+0x6159EC0(and 1,961 of the 0.001 next to it), so changing it in place changed all of them.The patch now:
+0x6159EC8, which no load reaches (0 found by the same scan);+0x2226045(c5 fa 10 1d 73 3e f3 03,vmovss xmm3,[rip+0x3F33E73]->+0x6159EC0) to that slot;The literal keeps 1/15 for the other loads. In-game the start prints
simulation step: cap 0.0667 s -> 0.2000 sand the title runs.Tests:
cargo test -p darner-loader --lib frame_rate-> 6 passed, includingthe_step_cap_site_is_checked(stock accepted, wrong cap/floor/slot/load refused). The run.rs line and the 16-byte test from your last message are inc907b95.Added a note in
bfb34ab, from an A/B on the same spot: with the stock 1/15 cap the boats on the water sit still; withDARNER_SIM_STEP_MAX=0.2(125 ms steps at 8-10 fps) distant boats jitter up and down; with0.1(10 fps in real time) they are stable. So 0.1 is the value I would suggest for a PC in this frame-rate range; 0.2 is still there for anyone who wants 5 fps in real time.Test needed — commit
bfb34abd; what to check: the change described aboveEvidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.