d3d12: count compute pipelines created, stood in and replaced #582

Closed
csj0oe wants to merge 1 commit from upstream-pr/582 into main
csj0oe commented 2026-11-30 07:48:50 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-30T07:48:50Z.


What

Compute pipelines that miss the compile deadline are replaced by empty stand-ins, but nothing reports how many were created, stood in, or later replaced by a finished compile, so a change to the 512 KiB threshold or the 20 s deadline cannot be judged.

Adds one exit line from the library's detach callback:

slot 62 compute pipelines: N created, M stand-ins, K replaced
  • Scoped to slot 62 deliberately: slot 86 compute streams create and stand in through a different path and are never replaced, so a whole-run claim would be wrong. The per-failure records still name each stand-in's cause.
  • No threshold or deadline change; no allocation when TUXBOX_LOG is unset.

Tests

runtime/d3d12/src/tests/progress.rs::the_compute_summary_names_each_outcome_once pins that each outcome is named once. It is typechecked for Windows; native execution of the windows crate is not possible here.

Not run

The line itself has not been observed in a real run; no GPU suite exercises the counter. NVIDIA not applicable.

<!-- greyfinch-sync:brcly/TuxBox:issue:5561197115 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/582). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-30T07:48:50Z. --- ## What Compute pipelines that miss the compile deadline are replaced by empty stand-ins, but nothing reports how many were created, stood in, or later replaced by a finished compile, so a change to the 512 KiB threshold or the 20 s deadline cannot be judged. Adds one exit line from the library's detach callback: ``` slot 62 compute pipelines: N created, M stand-ins, K replaced ``` - Scoped to slot 62 deliberately: slot 86 compute streams create and stand in through a different path and are never replaced, so a whole-run claim would be wrong. The per-failure records still name each stand-in's cause. - No threshold or deadline change; no allocation when `TUXBOX_LOG` is unset. ## Tests `runtime/d3d12/src/tests/progress.rs::the_compute_summary_names_each_outcome_once` pins that each outcome is named once. It is typechecked for Windows; native execution of the `windows` crate is not possible here. ## Not run The line itself has not been observed in a real run; no GPU suite exercises the counter. NVIDIA not applicable.
brcly commented 2026-11-30 09:50:08 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T09:50:08Z.


Thanks. Knowing how many compute pipelines were stood in and later replaced would be useful for judging the 512 KiB threshold and the 20 s deadline. I'm holding this version, though, because of where it reports:

  1. An exit line rarely lands. A run ends when the title is closed or killed, and our boots almost always end with the process being killed. atexit callbacks don't run then, so the line won't appear in the runs we'd judge a threshold by. The PR says it hasn't been observed in a real run yet, and I'd expect that to stay true for most runs.
  2. Logging from a DLL detach is risky. By then the title's other threads have been terminated, possibly while holding the logging lock or the allocator's, and the call runs under the loader lock. A diagnostic must not be able to hang a title on exit.
  3. The data is partly there already. The failure records name each stand-in, and the progress panel counts them.

Report the counts while the run is live instead: either alongside the progress panel's existing stand-in count, or as a log line each time a stand-in is replaced (compute_replaced already returns the running total). Then show the line from a real boot with a few stand-ins in it. With that, I'm happy to merge it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7274749820 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/582#issuecomment-7274749820). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T09:50:08Z. --- Thanks. Knowing how many compute pipelines were stood in and later replaced would be useful for judging the 512 KiB threshold and the 20 s deadline. I'm holding this version, though, because of where it reports: 1. **An exit line rarely lands.** A run ends when the title is closed or killed, and our boots almost always end with the process being killed. `atexit` callbacks don't run then, so the line won't appear in the runs we'd judge a threshold by. The PR says it hasn't been observed in a real run yet, and I'd expect that to stay true for most runs. 2. **Logging from a DLL detach is risky.** By then the title's other threads have been terminated, possibly while holding the logging lock or the allocator's, and the call runs under the loader lock. A diagnostic must not be able to hang a title on exit. 3. **The data is partly there already.** The failure records name each stand-in, and the progress panel counts them. Report the counts while the run is live instead: either alongside the progress panel's existing stand-in count, or as a log line each time a stand-in is replaced (`compute_replaced` already returns the running total). Then show the line from a real boot with a few stand-ins in it. With that, I'm happy to merge it.
csj0oe commented 2026-11-30 10:10:30 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-30T10:10:30Z.


Closing, agreed on the exit-time problem: killed runs skip atexit, and detaching a logger under the loader lock is worse than the counts are worth. Live reporting needs the fault reproduced first, so it goes in with that run rather than as its own PR. Branch kept.

<!-- greyfinch-sync:brcly/TuxBox:comment:7275230831 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/582#issuecomment-7275230831). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-30T10:10:30Z. --- Closing, agreed on the exit-time problem: killed runs skip `atexit`, and detaching a logger under the loader lock is worse than the counts are worth. Live reporting needs the fault reproduced first, so it goes in with that run rather than as its own PR. Branch kept.

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
brcly/TuxBox!582
No description provided.