WIP: [pr-diagnostics] Log frames of 50 ms or more with their time breakdown (DARNER_LONG_FRAMES, off by default) #7
Loading…
Reference in a new issue
No description provided.
Delete branch "Jesper-A/Darner:pr5-long-frames"
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?
Re-filed from CodeFloe #325 (the CodeFloe repo is gone; nothing was migrated). Same branch and commit.
Base: the branch is on
f2bccf656, themaincommit it was cut from.mainis nowdd2f061d5. Not rebased (we rebase only if you ask). A text-only trial merge (git merge-tree --write-tree trustno1/main pr5-long-frames) conflicts indocs/findings.mdonly; the code files merge cleanly.Contributor role (optional)
What it changes
New: with
DARNER_LONG_FRAMES=1, every frame of 50 ms or more gets onelong framelog line. The line splits that frame's time into submission preparing, GPU wait, title copy (ms and MB) and texture refresh (ms and MB hashed). At most 5,000 lines a run.Why: the once-a-second log lines average a hitch away. These lines say what a hitch was made of.
Off (the default): one load per frame. On: twelve relaxed loads and an uncontended lock per frame, no allocation, and a line only for a long frame. It reads the run totals, so the once-a-second swaps do not disturb it. The code sits under
host::gaps(host/gaps/long_frame.rs) because the counters are private tohost.rs, which is over the policy size limit. A short section indocs/findings.mddescribes it.Not a bug fix, so no
Fixes/Refs.Credit: port of lobomfz/VIctory-xmem PR #258 (author Jojonobody2). That is a PR in the xmem fork, not a Darner number. Differences from the original: a switch, the run totals instead of the live counters, and a pure, tested decision (
due,spent).Spec dependence
Likely general. It reads host-side counters only and does not depend on GPU, driver or console profile. Untested on other hardware.
How it was tested
Tested revision:
4a5f13ff6on basef2bccf656(not rebased on the currentmain,dd2f061d5).Commands and results: our notes record "4 tests pass, clippy, policy ok" for this commit; the exact command lines and the clippy scope were not recorded. So the three gates are pending for this commit:
cargo clippy --workspace --all-targets --locked -- -D warnings: pendingcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: pendingcargo test --workspace --locked: pendingThere is no CI upstream, and nothing here claims one.
Gameplay, when relevant: not run in the game. The log line has not been seen in a real run.
Before and after, when relevant: none. No speed claim.
Shader wave sizes tested, when relevant: not relevant.
Coverage gaps: no run with the switch on; real output format and the cost per frame unmeasured; at about 17 fps most frames are over 50 ms, so the switch is only useful on a fast run or it fills the 5,000-line cap.
Checklist
main(basef2bccf656).docs/asset-policy.md(cargo xtask policyon4a5f13ff6: "asset policy: 532 files ok").Checked for overlap
DARNER_LONG_FRAMESor long-frame logging. On 2026-12-03 this host had 3 issues and 1 pull request in total; none is about it. The one open pull request (#3, ray tracing mode in F1) changeshost/menu.rs,host/panel.rsandhwrt.rs, so it touches none of this change's files (hot.rs,host/gaps.rs,host/gaps/long_frame.rs,docs/findings.md) and nothost.rs.This change was made with AI assistance (Claude Code).
darner rig, F1 AUTO-DETECT row, per-start switches (DARNER_AUTO_SWITCHES, on by default, =0 turns it off) #25