WIP: [pr-diagnostics] Log frames of 50 ms or more with their time breakdown (DARNER_LONG_FRAMES, off by default) #7

Manually merged
TrustNo1 merged 0 commits from Jesper-A/Darner:pr5-long-frames into main 2026-12-03 18:35:50 +00:00
Contributor

Re-filed from CodeFloe #325 (the CodeFloe repo is gone; nothing was migrated). Same branch and commit.

Base: the branch is on f2bccf656, the main commit it was cut from. main is now dd2f061d5. Not rebased (we rebase only if you ask). A text-only trial merge (git merge-tree --write-tree trustno1/main pr5-long-frames) conflicts in docs/findings.md only; the code files merge cleanly.

Contributor role (optional)

  • Fluxer ID:

What it changes

New: with DARNER_LONG_FRAMES=1, every frame of 50 ms or more gets one long frame log 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 to host.rs, which is over the policy size limit. A short section in docs/findings.md describes 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: 4a5f13ff6 on base f2bccf656 (not rebased on the current main, 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: pending
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: pending
    • cargo test --workspace --locked: pending

    There 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

  • This PR contains one change based on main (base f2bccf656).
  • The diff follows docs/asset-policy.md (cargo xtask policy on 4a5f13ff6: "asset policy: 532 files ok").
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found for DARNER_LONG_FRAMES or 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) changes host/menu.rs, host/panel.rs and hwrt.rs, so it touches none of this change's files (hot.rs, host/gaps.rs, host/gaps/long_frame.rs, docs/findings.md) and not host.rs.

This change was made with AI assistance (Claude Code).

Re-filed from CodeFloe #325 (the CodeFloe repo is gone; nothing was migrated). Same branch and commit. **Base:** the branch is on `f2bccf656`, the `main` commit it was cut from. `main` is now `dd2f061d5`. Not rebased (we rebase only if you ask). A text-only trial merge (`git merge-tree --write-tree trustno1/main pr5-long-frames`) conflicts in `docs/findings.md` only; the code files merge cleanly. ## Contributor role (optional) - Fluxer ID: ## What it changes New: with `DARNER_LONG_FRAMES=1`, every frame of 50 ms or more gets one `long frame` log 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 to `host.rs`, which is over the policy size limit. A short section in `docs/findings.md` describes 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: 4a5f13ff6 on base f2bccf656 (not rebased on the current `main`, `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`: pending - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: pending - `cargo test --workspace --locked`: pending There 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 - [x] This PR contains one change based on `main` (base f2bccf656). - [x] The diff follows `docs/asset-policy.md` (`cargo xtask policy` on 4a5f13ff6: "asset policy: 532 files ok"). - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found for `DARNER_LONG_FRAMES` or 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) changes `host/menu.rs`, `host/panel.rs` and `hwrt.rs`, so it touches none of this change's files (`hot.rs`, `host/gaps.rs`, `host/gaps/long_frame.rs`, `docs/findings.md`) and not `host.rs`. This change was made with AI assistance (Claude Code).
With DARNER_LONG_FRAMES=1 each frame of 50 ms or more gets a `long frame`
line: preparing, GPU wait, title copy and texture refresh time, at most
5,000 lines a run. The once-a-second lines average a hitch away; these say
what it was. Off, it costs one load a frame; on, no allocation and a line
only for a long frame. Reads the run totals, so the second's swaps do not
disturb it. Sits under host::gaps because the counters are private to
host.rs, which is over the policy size limit.

Port of lobomfz/VIctory-xmem PR #258 (author Jojonobody2)

This change was made with AI assistance (Claude Code).
TrustNo1 manually merged commit 669d432338 into main 2026-12-03 18:35:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!7
No description provided.