startup: count refused slot 70 calls, slot 70 writes and token texture nulls #2243

Merged
rasptum merged 8 commits from upstream-pr/2251 into main 2026-11-25 08:42:24 +00:00
rasptum commented 2026-11-25 07:53:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-25T07:53:38Z.


A translated draw binds a null texture SRV when its descriptor-table entry carries no stand-in view token (null cause token). Two producers fit such an entry:

  • a refused device slot 70 call, which leaves the destination as it was. Its refusal lines stop after eight.
  • a descriptor the title writes itself.

The existing totals line counts these nulls, but nothing tells the two producers apart. This change adds counters and detail lines only; no descriptor, view or texture behaves differently.

Five-second report (src/startup_stubs/memory_srv_census.h, printed only when the counts changed):

  • x2w-d3d12 memory SRV refusals (slot 70): total N; <reason> n, ...; distinct shapes K counts refusals by reason. It adds one refused shape line per distinct reason, dimension, format, size, mips, layout and flags, for each reason that depends on the description (up to 128 shapes; later ones are counted as calls past the table). Only shapes counted since the last report are printed.
  • x2w-d3d12 memory SRV writes (slot 70): calls N, distinct entries D counts successful slot 70 calls.
  • x2w-draw token texture nulls: total N in P pipelines; <key>=n ... gives per-pipeline counts (up to 16).

The reasons include gpu_written_resource and texture_unavailable of the single-element path (#2157), the partial-tile holds of #2105 (partial_tile_xg_rows, partial_tile_beyond_xg_size) and the console-layout holds of #2015 (unsupported_desktop_format, console_layout_xg_rows, console_layout_without_footprints, console_layout_beyond_xg_size, overlapping_resource). Every reason the slot 70 code logs is counted under its own name, and shapes are kept for every reason that depends on the description. tools/startup/triage_run.py had folded the five #2015 holds into other; its allowlist and test now name them too.

Detail lines:

  • The existing Device::slot70 refusal line for the first refusal of each of the first 8 distinct shapes, even after the 8-line limit is spent. Its format and reason tokens are unchanged, so tools/startup/triage_run.py and its tests need no change.
  • x2w-d3d12 memory SRV written i: ... for the first write to each of the first 8 distinct destinations.
  • x2w-draw token texture null: pipeline <key> srv <i> entry <address> words <w0> ... <w7> for the first token null of each of the first 4 pipelines. All-zero words mean nothing wrote the entry.

Tests (source-built, WARP):

  • startup_memory_srv_census: detail and overflow limits, the reason/shape split, and the skip-when-unchanged report, without a device.
  • startup_memory_srv_diag_warp:
    • eight zero-address refusals spend the line limit;
    • a 2048x2048 BC1 10-mip texture is refused, and a draw samples the untouched entry;
    • a supported 1-mip R8 texture is then published and sampled.
    • Expected: one counted BC1 shape with its Device::slot70 line as the ninth refusal line, one write line for the R8 entry, one token null with eight zero words, a null view in column 0 and the R8 texels in column 1.
  • startup_memory_srv_diag_supported_control_warp publishes the supported R8 texture in place of the BC1 one. It returns 0 only when the check then stops at exactly column 0 row 0: 100000ff, expected a null view (000000ff) (column 0 samples the R8 texel), 77 on a capability skip and 1 for anything else, including a pass. No test is registered WILL_FAIL.

Commands and results (Windows 10 19045, WARP):

ctest --preset <dev|release> --no-tests=error -R '^(startup_memory_srv_.*|startup_null_views.*|startup_null_cause_labels.*|startup_stream_draw_warp|startup_address_srv_warp|startup_address_single_element_warp|startup_address_buffer_srv_warp|startup_address_bc_view_warp|startup_single_element_srv.*)$' -V

At head 0a9c8930 (main f277710e merged): dev 20/20 passed, release 20/20 passed, no skips. The set includes the existing slot 70 tests (startup_address_srv_warp, startup_address_single_element_warp, startup_address_buffer_srv_warp, startup_address_bc_view_warp), the draw-path and null-binding tests, and the new census, scenario and control tests.

The slot 70 tests from #2015 also pass on both presets, 8/8 each: startup_address_console_*, including the gate, ring and hardware variants, and startup_gfx10_layout, startup_gfx10_layout_display_control. Command: ctest --preset <dev|release> --no-tests=error -R '^(startup_address_console_.*|startup_gfx10_layout.*)$'.

The pure-Python checks listed in AGENTS.md pass: 99 passed. startup_build_rev_check.py reports a capability skip (77) where cmake is not on PATH.

Overlap: #1938 (still open) adds acceleration-structure refusal reasons (as_unaligned, as_not_placed, as_wrong_state) to the same function. This census counts them as other until they are added to the list.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6599837064 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2251). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-25T07:53:38Z. --- A translated draw binds a null texture SRV when its descriptor-table entry carries no stand-in view token (null cause `token`). Two producers fit such an entry: - a refused device slot 70 call, which leaves the destination as it was. Its refusal lines stop after eight. - a descriptor the title writes itself. The existing totals line counts these nulls, but nothing tells the two producers apart. This change adds counters and detail lines only; no descriptor, view or texture behaves differently. **Five-second report** (`src/startup_stubs/memory_srv_census.h`, printed only when the counts changed): - `x2w-d3d12 memory SRV refusals (slot 70): total N; <reason> n, ...; distinct shapes K` counts refusals by reason. It adds one `refused shape` line per distinct reason, dimension, format, size, mips, layout and flags, for each reason that depends on the description (up to 128 shapes; later ones are counted as calls past the table). Only shapes counted since the last report are printed. - `x2w-d3d12 memory SRV writes (slot 70): calls N, distinct entries D` counts successful slot 70 calls. - `x2w-draw token texture nulls: total N in P pipelines; <key>=n ...` gives per-pipeline counts (up to 16). The reasons include `gpu_written_resource` and `texture_unavailable` of the single-element path (#2157), the partial-tile holds of #2105 (`partial_tile_xg_rows`, `partial_tile_beyond_xg_size`) and the console-layout holds of #2015 (`unsupported_desktop_format`, `console_layout_xg_rows`, `console_layout_without_footprints`, `console_layout_beyond_xg_size`, `overlapping_resource`). Every reason the slot 70 code logs is counted under its own name, and shapes are kept for every reason that depends on the description. `tools/startup/triage_run.py` had folded the five #2015 holds into `other`; its allowlist and test now name them too. **Detail lines:** - The existing `Device::slot70` refusal line for the first refusal of each of the first 8 distinct shapes, even after the 8-line limit is spent. Its format and reason tokens are unchanged, so `tools/startup/triage_run.py` and its tests need no change. - `x2w-d3d12 memory SRV written i: ...` for the first write to each of the first 8 distinct destinations. - `x2w-draw token texture null: pipeline <key> srv <i> entry <address> words <w0> ... <w7>` for the first token null of each of the first 4 pipelines. All-zero words mean nothing wrote the entry. **Tests** (source-built, WARP): - `startup_memory_srv_census`: detail and overflow limits, the reason/shape split, and the skip-when-unchanged report, without a device. - `startup_memory_srv_diag_warp`: - eight zero-address refusals spend the line limit; - a 2048x2048 BC1 10-mip texture is refused, and a draw samples the untouched entry; - a supported 1-mip R8 texture is then published and sampled. - Expected: one counted BC1 shape with its `Device::slot70` line as the ninth refusal line, one write line for the R8 entry, one token null with eight zero words, a null view in column 0 and the R8 texels in column 1. - `startup_memory_srv_diag_supported_control_warp` publishes the supported R8 texture in place of the BC1 one. It returns 0 only when the check then stops at exactly `column 0 row 0: 100000ff, expected a null view (000000ff)` (column 0 samples the R8 texel), 77 on a capability skip and 1 for anything else, including a pass. No test is registered `WILL_FAIL`. **Commands and results** (Windows 10 19045, WARP): ```powershell ctest --preset <dev|release> --no-tests=error -R '^(startup_memory_srv_.*|startup_null_views.*|startup_null_cause_labels.*|startup_stream_draw_warp|startup_address_srv_warp|startup_address_single_element_warp|startup_address_buffer_srv_warp|startup_address_bc_view_warp|startup_single_element_srv.*)$' -V ``` At head 0a9c8930 (main f277710e merged): dev 20/20 passed, release 20/20 passed, no skips. The set includes the existing slot 70 tests (`startup_address_srv_warp`, `startup_address_single_element_warp`, `startup_address_buffer_srv_warp`, `startup_address_bc_view_warp`), the draw-path and null-binding tests, and the new census, scenario and control tests. The slot 70 tests from #2015 also pass on both presets, 8/8 each: `startup_address_console_*`, including the gate, ring and hardware variants, and `startup_gfx10_layout`, `startup_gfx10_layout_display_control`. Command: `ctest --preset <dev|release> --no-tests=error -R '^(startup_address_console_.*|startup_gfx10_layout.*)$'`. The pure-Python checks listed in AGENTS.md pass: 99 passed. `startup_build_rev_check.py` reports a capability skip (77) where cmake is not on PATH. **Overlap:** #1938 (still open) adds acceleration-structure refusal reasons (`as_unaligned`, `as_not_placed`, `as_wrong_state`) to the same function. This census counts them as `other` until they are added to the list. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tedin7 commented 2026-11-25 08:05:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T07:59:31Z.

Review: COMMENTED


Review of head 0a9c89308def9ab8643aace1d609467e30b425d4 (counters and log lines only).

Verdict: no P1, no P2. Looks correct.

What I checked:

  • Every refusal path in device_memory_srv now goes through refuse_memory_srv, and every success path through note_memory_srv_write. I found no path that is counted twice or skipped.
  • The old 8-line refusal limit is kept. A detail line is added only for the first 8 distinct shapes, so log volume stays bounded.
  • The token-null census in d3d12_draw.inl runs after count_null_binding and does not change the descriptor, view or texture that gets bound.
  • Title is neutral and the PR is clean-room. The head is MERGEABLE, and the CI jobs that ran (Linux Python checks, Windows build and test, fixtures) all pass.

Commands executed locally:

  • python3 tests/docs_links_check.py: passed (18 files, 413 links)
  • python3 tests/bidi_controls_check.py: passed (1512 files)
  • git diff --check origin/main...HEAD: clean
  • python3 tests/startup_triage_run_check.py: 0 failed
  • Win2025 dev (x2w_pipe.py win2025 2251 --regex 'startup_memory_srv|startup_triage|startup_stream' --skip-release): startup_memory_srv_census, startup_memory_srv_diag_warp, startup_memory_srv_diag_supported_control_warp and startup_memory_srv_diag_hardware all pass.
  • Mutation: I changed detail = shape_count_ < detail_shapes; to <= in memory_srv_census.h. startup_memory_srv_census failed with "ninth shape is not", so the test kills it. I reverted the change.

Notes (not blocking):

  • nit, unrelated to this PR: on that same Win2025 run, startup_memory_srv_buffer_{height,exact-fit,first-32}_control reported Failed. They are WILL_FAIL controls and their output was "all checks passed". The PR does not touch memory_srv_buffer or its test, so this is not caused by it. It is worth a separate look on main.
  • nit: startup_memory_srv_census_check.cpp includes windows.h through the header, so it cannot be built on Linux. Only the Windows run covers it. I did not run the release configuration.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6053797932 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2251#pullrequestreview-6053797932). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T07:59:31Z. **Review:** COMMENTED --- Review of head `0a9c89308def9ab8643aace1d609467e30b425d4` (counters and log lines only). **Verdict: no P1, no P2. Looks correct.** What I checked: - Every refusal path in `device_memory_srv` now goes through `refuse_memory_srv`, and every success path through `note_memory_srv_write`. I found no path that is counted twice or skipped. - The old 8-line refusal limit is kept. A detail line is added only for the first 8 distinct shapes, so log volume stays bounded. - The token-null census in `d3d12_draw.inl` runs after `count_null_binding` and does not change the descriptor, view or texture that gets bound. - Title is neutral and the PR is clean-room. The head is MERGEABLE, and the CI jobs that ran (Linux Python checks, Windows build and test, fixtures) all pass. Commands executed locally: - `python3 tests/docs_links_check.py`: passed (18 files, 413 links) - `python3 tests/bidi_controls_check.py`: passed (1512 files) - `git diff --check origin/main...HEAD`: clean - `python3 tests/startup_triage_run_check.py`: 0 failed - Win2025 dev (`x2w_pipe.py win2025 2251 --regex 'startup_memory_srv|startup_triage|startup_stream' --skip-release`): `startup_memory_srv_census`, `startup_memory_srv_diag_warp`, `startup_memory_srv_diag_supported_control_warp` and `startup_memory_srv_diag_hardware` all pass. - Mutation: I changed `detail = shape_count_ < detail_shapes;` to `<=` in `memory_srv_census.h`. `startup_memory_srv_census` failed with "ninth shape is not", so the test kills it. I reverted the change. Notes (not blocking): - **nit, unrelated to this PR:** on that same Win2025 run, `startup_memory_srv_buffer_{height,exact-fit,first-32}_control` reported Failed. They are WILL_FAIL controls and their output was "all checks passed". The PR does not touch `memory_srv_buffer` or its test, so this is not caused by it. It is worth a separate look on main. - **nit:** `startup_memory_srv_census_check.cpp` includes `windows.h` through the header, so it cannot be built on Linux. Only the Windows run covers it. I did not run the release configuration. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 09:04:00 +00:00
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
R0Y00/Xbox2Windows!2243
No description provided.