gpu: VICTORY_TRACE_PIPELINES logs pipelines made and put off, by frame #350

Closed
ShadyUnderLight wants to merge 1 commit from upstream-pr/350 into main
ShadyUnderLight commented 2026-11-27 13:43:16 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by ShadyUnderLight on 2026-11-27T13:43:16Z.


What and why

The frame log's native draws so far line comes every 64 presents and carries no pipeline counters, so "how many pipelines did this frame make, and how many did it put off" cannot be read from a log. That is exactly the question a crash storm raises: a compile that crashes Metal's compiler spends the rest of its frame's pipeline budget, so that frame's other new pipelines are put off. Do they ever get made?

What it does

VICTORY_TRACE_PIPELINES=1 logs native pipelines so far at every present whose counters moved: frame, made (ShaderStats::pipelines), put_off (ShaderStats::put_off) and cached (ShaderStats::cached), each cumulative. A frame whose counters did not move writes nothing, so a cold first world frame and each later frame that binds new pipelines get a line while quiet frames do not.

Off (the default) it costs one read of the switch per present; the title lock is taken only when it is on. Documented under "Bring-up diagnostics", with a pointer from "Reading the log" beside VICTORY_TRACE_SHADER_CACHE.

Checks

  • cargo test -p victory-gpu -p victory-metal -p victory-shader (native arm64): 357 / 36 / 12 / 16 / 370 / 5 passed, 0 failed.
  • cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings: clean.
  • cargo xtask policy: 384 files ok.
  • Used on a 400 s world run (macOS 27.2.1, M5 Max, series-x): 107 lines, so the resolution is there for the frames that do pipeline work.

No behaviour change: nothing reads these counters.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5527645739 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/350). Originally posted by [ShadyUnderLight](https://github.com/ShadyUnderLight) on 2026-11-27T13:43:16Z. --- ## What and why The frame log's `native draws so far` line comes every 64 presents and carries no pipeline counters, so "how many pipelines did this frame make, and how many did it put off" cannot be read from a log. That is exactly the question a crash storm raises: a compile that crashes Metal's compiler spends the rest of its frame's pipeline budget, so that frame's other new pipelines are put off. Do they ever get made? ## What it does `VICTORY_TRACE_PIPELINES=1` logs `native pipelines so far` at every present whose counters moved: `frame`, `made` (`ShaderStats::pipelines`), `put_off` (`ShaderStats::put_off`) and `cached` (`ShaderStats::cached`), each cumulative. A frame whose counters did not move writes nothing, so a cold first world frame and each later frame that binds new pipelines get a line while quiet frames do not. Off (the default) it costs one read of the switch per present; the title lock is taken only when it is on. Documented under "Bring-up diagnostics", with a pointer from "Reading the log" beside `VICTORY_TRACE_SHADER_CACHE`. ## Checks - `cargo test -p victory-gpu -p victory-metal -p victory-shader` (native arm64): 357 / 36 / 12 / 16 / 370 / 5 passed, 0 failed. - `cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings`: clean. - `cargo xtask policy`: 384 files ok. - Used on a 400 s world run (macOS 27.2.1, M5 Max, series-x): 107 lines, so the resolution is there for the frames that do pipeline work. No behaviour change: nothing reads these counters.
ShadyUnderLight commented 2026-11-27 14:02:49 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by ShadyUnderLight on 2026-11-27T14:02:49Z.


This is the instrument I used to answer the put-off/made numbers on #181 and #318, not a fix, and nobody asked for the line itself. Keeping it out of the review queue; the branch diag/pipeline-counts stays on my fork if you ever want it.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7220264558 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/350#issuecomment-7220264558). Originally posted by [ShadyUnderLight](https://github.com/ShadyUnderLight) on 2026-11-27T14:02:49Z. --- This is the instrument I used to answer the put-off/made numbers on #181 and #318, not a fix, and nobody asked for the line itself. Keeping it out of the review queue; the branch `diag/pipeline-counts` stays on my fork if you ever want it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
LakshanSivakumar/Native-Victory-macOS!350
No description provided.