startup: compute input snapshots are taken before the dispatch's outputs are validated, so refused dispatches use the snapshot pool #3479

Closed
opened 2026-11-29 16:54:14 +00:00 by Leyukaka · 0 comments
Leyukaka commented 2026-11-29 16:54:14 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T16:54:14Z.


Part of #870.

In the translated compute dispatch, one loop resolves the inputs and then the outputs (src/startup_stubs/d3d12_compute_dispatch.inl:831 on main c4b8a41b; inputs come first in views).

  • Inputs: indirect_table_buffer is called at :1029-1030. For an input that lives only in guest memory it copies the range into the 128 MiB snapshot pool at that point (src/startup_stubs/d3d12_draw.inl:2692-2702), and compute_inputs_snapshot is incremented at d3d12_compute_dispatch.inl:1046-1048.
  • Outputs: checked later in the same loop, for example the output interval limit (:734), the copied-object UAV switch (:754), "an output buffer is also an input" (:1103, :1189) and zero records (:1172).

A dispatch refused on an output has already reserved pool space for its inputs. That space is reused only once the recording's chunks complete.

One local run of the application (about 1,430 s, counts only):

  • 1,499,016 snapshot inputs counted for 114,737 recorded dispatches.
  • The pool refused reservations from about 132 s (8 logged lines, then the log cap).
  • 10,930 dispatches of 9 programs were refused because an input could not be copied. The same 9 programs made 95,695 of the 114,737 translated dispatches.

Not measured: how much of the pool the refused dispatches used. The pool has no counters (see the diagnostics issue).

Change: resolve snapshot inputs as pending (address, bytes) and copy them after the output checks pass; count compute_inputs_snapshot only for recorded dispatches.

I'm working on this.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6681463263 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3479). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T16:54:14Z. --- Part of #870. In the translated compute dispatch, one loop resolves the inputs and then the outputs (`src/startup_stubs/d3d12_compute_dispatch.inl:831` on `main` `c4b8a41b`; inputs come first in `views`). - Inputs: `indirect_table_buffer` is called at `:1029-1030`. For an input that lives only in guest memory it copies the range into the 128 MiB snapshot pool at that point (`src/startup_stubs/d3d12_draw.inl:2692-2702`), and `compute_inputs_snapshot` is incremented at `d3d12_compute_dispatch.inl:1046-1048`. - Outputs: checked later in the same loop, for example the output interval limit (`:734`), the copied-object UAV switch (`:754`), "an output buffer is also an input" (`:1103`, `:1189`) and zero records (`:1172`). A dispatch refused on an output has already reserved pool space for its inputs. That space is reused only once the recording's chunks complete. One local run of the application (about 1,430 s, counts only): - 1,499,016 snapshot inputs counted for 114,737 recorded dispatches. - The pool refused reservations from about 132 s (8 logged lines, then the log cap). - 10,930 dispatches of 9 programs were refused because an input could not be copied. The same 9 programs made 95,695 of the 114,737 translated dispatches. Not measured: how much of the pool the refused dispatches used. The pool has no counters (see the diagnostics issue). Change: resolve snapshot inputs as pending (address, bytes) and copy them after the output checks pass; count `compute_inputs_snapshot` only for recorded dispatches. I'm working on this.
Sign in to join this conversation.
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
R0Y00/Xbox2Windows#3479
No description provided.