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

Manually merged
github merged 8 commits from gh-pr/2251/head into gh-pr/2251/base 2026-11-27 00:09:47 +00:00
Owner

@⁠rasptum on GitHub · 2026-11-25 07:53 UTC · original
rasptum:startup/memory-srv-diagnostics → main · +733 −13 · 12 files · 8 commits · merged 2026-11-25 08:42 UTC

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

**@⁠rasptum** on GitHub · 2026-11-25 07:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2251) `rasptum:startup/memory-srv-diagnostics` → `main` · +733 −13 · 12 files · 8 commits · merged 2026-11-25 08:42 UTC 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)
A loading sequence can draw sampled textures black when their descriptor-
table entry holds no stand-in view token. The draw then binds a null SRV
(cause "token"). One candidate producer is device slot 70: a refused call
leaves the destination as it was, and its refusal lines stop after eight.
Another is a descriptor the title writes itself. These lines tell them
apart; they count and print only, nothing changes on any descriptor.

src/startup_stubs/memory_srv_census.h, printed with the five-second report
when the counts changed:
- refused slot 70 calls per reason, and per distinct reason, dimension,
  format, size, mips, layout and flags for the reasons a different
  description could avoid (up to 32 shapes);
- successful slot 70 writes and distinct destination entries;
- texture SRVs bound null with cause token, per translated pipeline.
Detail lines: the existing Device::slot70 line for the first refusal of
each of the first 8 distinct shapes, even past the 8-line limit; one line
for the first write to each of the first 8 distinct entries; and the first
8 words of the entry for the first token null of each of the first 4
pipelines (all zero: nothing wrote the entry). The Device::slot70 line
format and reasons are unchanged, so tools/startup/triage_run.py parses
them as before.

Tests:
- startup_memory_srv_census: the limits without a device.
- startup_memory_srv_diag_warp: eight zero-address refusals spend the line
  limit, a 2048x2048 BC1 10-mip texture is refused, a draw samples the
  untouched entry, then a supported 1-mip R8 texture is published and
  sampled. Expects one counted BC1 shape with its line past the limit,
  one write line for the R8 entry, one token null with zero words, and
  the R8 texels.
- startup_memory_srv_diag_supported_control_warp publishes the R8 texture
  in place of the BC1 one and must fail (column 0 then shows the texel).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A diagnostic run overflowed the 32-shape table. Keep 128. The periodic
report now lists only the shapes counted since it last ran, so a full
table does not repeat every five seconds; a forced report lists all.

Test: startup_memory_srv_census (the new limit, the changed-only periodic
listing, and the forced listing).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	src/startup_stubs/d3d12_memory_srv.inl
Keeps both sides' test registrations in CMakeLists.txt and
tests/startup_stream_draw.cpp. The single-element path from main counts
its refusals (gpu_written_resource, texture_unavailable) and its write
in the slot 70 census; gpu_written_resource joins the census reasons.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The census test now uses 0x1000000000000001 as its pipeline key. The
supported-texture control returns 0 only when the diag check stops at
the exact column 0 mismatch the supported publish causes, 77 on a
capability skip and 1 otherwise; it is no longer registered WILL_FAIL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2015 added five hold reasons (unsupported_desktop_format,
console_layout_xg_rows, console_layout_without_footprints,
console_layout_beyond_xg_size, overlapping_resource). The census and
tools/startup/triage_run.py counted them as "other"; both now name them,
and the census keeps shapes for every reason that depends on the
description. The summary line buffer grows to fit the longer list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:09:45 +00:00
github manually merged commit 0a9c89308d into gh-pr/2251/base 2026-11-27 00:09:47 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 07:59 UTC · original · reviewed

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.

**@⁠tedin7** on GitHub · 2026-11-25 07:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2251#pullrequestreview-6053797932) · **reviewed** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.