startup: name the cause of a slot 70 texture_unavailable refusal in the memory SRV census #2828

Merged
tedin7 merged 2 commits from upstream-pr/2836 into main 2026-11-27 19:36:26 +00:00
tedin7 commented 2026-11-26 12:45:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:45:27Z.


Part of #870
Fixes #2831

What this unblocks: a run that shows slot 70 texture_unavailable refusals can say whether to chase a missing resource, unreadable texels or the 64 MiB limit.

What changed. device_memory_srv refused with texture_unavailable for three different situations. It now names the cause, in the census line, the per-call log line, tools/startup/triage_run.py (SLOT70_REASONS) and docs/startup-runtime.md:

  • texture_no_resource: no live resource matches the base address and description (the lookup of an existing texture found nothing),
  • texture_unreadable: the texels of the published layout cannot be read,
  • texture_over_64mib: the layout is larger than the 64 MiB the transient upload ring accepts for one copy (max_published_texture_bytes, the constant publish_tiled_texture already used),
  • texture_unavailable stays for a publication that fails for any other reason.

The decision is one pure function, x2w_startup::texture_unavailable_cause in memory_srv_census.h (the 64 MiB limit is one constant there), so startup_memory_srv_census_check tests every branch without a device.

Why it is correct. The three causes are the three exits the existing comment named ("no resource there, or texels not readable or over 64 MiB"); the new helper texture_unavailable_reason re-derives the cause with the same size limit and the same readability test publish_tiled_texture applies. No view is published or refused differently: only the refusal name changes.

What stays as before. Which views are published or refused; the hold reasons (partial_tile_*, console_layout_*, unsupported_desktop_format, overlapping_resource).

Note for review. texture_unavailable_reason calls the readability test again on the refusal path, so a refusal whose cause is neither size nor unreadable memory pays one extra pass over the layout's pages; a count-only fast path is possible later if refusals are frequent.

Source: this repository: src/startup_stubs/d3d12_memory_srv.inl (publish_tiled_texture, the 64 MiB single-copy limit and the readable-texels test), src/startup_stubs/memory_srv_census.h, tools/startup/triage_run.py.

Verification:

  • python3 -B tests/startup_triage_run_check.py -> startup triage_run checks: 0 failed
  • x86_64-w64-mingw32-g++ -std=c++17 -static -Isrc tests/startup_memory_srv_census_check.cpp run under wine -> memory SRV census: PASS; with the mutant texture_over_64mib -> texture_unreadable in memory_srv_census.h it fails two checks ("over the limit: named by size", "over the limit and unreadable: still size").
  • Win2025 on the exact head a243e5b4c (independent peer run, proxmox, HEAD_SHA in the log): dev 27/27 and release 27/27, regex startup_memory_srv|startup_address_srv|startup_address_volume_srv|startup_triage. The mutant above is killed by startup_memory_srv_census (patch applied); an earlier mutant (texture_no_resource -> texture_unavailable) is killed by startup_address_srv and startup_address_volume_srv on warp and hardware.
  • The case-2 check in startup_address_volume_srv_check.py accepts texture_no_resource or texture_unreadable, because its short backing can be either.

Real-hardware testing: @Makto94 - thanks for the help.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5510261223 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2836). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T12:45:27Z. --- Part of #870 Fixes #2831 What this unblocks: a run that shows slot 70 `texture_unavailable` refusals can say whether to chase a missing resource, unreadable texels or the 64 MiB limit. **What changed.** `device_memory_srv` refused with `texture_unavailable` for three different situations. It now names the cause, in the census line, the per-call log line, `tools/startup/triage_run.py` (`SLOT70_REASONS`) and `docs/startup-runtime.md`: - `texture_no_resource`: no live resource matches the base address and description (the lookup of an existing texture found nothing), - `texture_unreadable`: the texels of the published layout cannot be read, - `texture_over_64mib`: the layout is larger than the 64 MiB the transient upload ring accepts for one copy (`max_published_texture_bytes`, the constant `publish_tiled_texture` already used), - `texture_unavailable` stays for a publication that fails for any other reason. The decision is one pure function, `x2w_startup::texture_unavailable_cause` in `memory_srv_census.h` (the 64 MiB limit is one constant there), so `startup_memory_srv_census_check` tests every branch without a device. **Why it is correct.** The three causes are the three exits the existing comment named ("no resource there, or texels not readable or over 64 MiB"); the new helper `texture_unavailable_reason` re-derives the cause with the same size limit and the same readability test `publish_tiled_texture` applies. No view is published or refused differently: only the refusal name changes. **What stays as before.** Which views are published or refused; the hold reasons (`partial_tile_*`, `console_layout_*`, `unsupported_desktop_format`, `overlapping_resource`). **Note for review.** `texture_unavailable_reason` calls the readability test again on the refusal path, so a refusal whose cause is neither size nor unreadable memory pays one extra pass over the layout's pages; a count-only fast path is possible later if refusals are frequent. Source: this repository: src/startup_stubs/d3d12_memory_srv.inl (`publish_tiled_texture`, the 64 MiB single-copy limit and the readable-texels test), src/startup_stubs/memory_srv_census.h, tools/startup/triage_run.py. Verification: - `python3 -B tests/startup_triage_run_check.py` -> `startup triage_run checks: 0 failed` - `x86_64-w64-mingw32-g++ -std=c++17 -static -Isrc tests/startup_memory_srv_census_check.cpp` run under wine -> `memory SRV census: PASS`; with the mutant `texture_over_64mib` -> `texture_unreadable` in `memory_srv_census.h` it fails two checks ("over the limit: named by size", "over the limit and unreadable: still size"). - Win2025 on the exact head `a243e5b4c` (independent peer run, proxmox, HEAD_SHA in the log): dev 27/27 and release 27/27, regex `startup_memory_srv|startup_address_srv|startup_address_volume_srv|startup_triage`. The mutant above is killed by `startup_memory_srv_census` (patch applied); an earlier mutant (`texture_no_resource` -> `texture_unavailable`) is killed by `startup_address_srv` and `startup_address_volume_srv` on warp and hardware. - The case-2 check in `startup_address_volume_srv_check.py` accepts `texture_no_resource` or `texture_unreadable`, because its short backing can be either. Real-hardware testing: @Makto94 - thanks for the help. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 14:00:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T13:37:02Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T13:39:30.247504Z a243e5b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7193598673 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2836#issuecomment-7193598673). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T13:37:02Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"a243e5b4c1f0bf84166274315561bc880fec2fe3","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T13:39:30.247504Z">2026-11-26T13:39:30.247504Z</relative-time> | `a243e5b` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
SimSalabimse commented 2026-11-26 16:07:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T16:07:02Z.


Hardware and WARP result for head a243e5b4c1f0bf84166274315561bc880fec2fe3: all pass. Part of #870.

Environment: Windows 11 25H2 (26200), MSVC 19.42, dev preset, NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135). Tests run serially, one ctest process.

Command

ctest --preset dev --no-tests=error -R "startup_memory_srv|slot70|startup_address_srv|address_buffer_srv|address_volume_srv|startup_triage|runtime_startup_triage"

Result (measured): 31/31 passed, exit code 0.

  • startup_memory_srv_census (the pure function texture_unavailable_cause).
  • startup_address_srv, startup_address_volume_srv and startup_memory_srv_diag, WARP and hardware (these read the new texture_no_resource and texture_unreadable names).
  • startup_triage_run and runtime_startup_triage_run_cli_check (SLOT70_REASONS).
  • The rest of the slot-70 group: startup_memory_srv_{report,buffer,as,volume} with controls, dxr_slot70_as (WARP and hardware), startup_address_buffer_srv (WARP and hardware).

What this shows: the renamed refusal causes read correctly on an NVIDIA adapter and nothing else in the slot-70 group changed.

What this does not show: I did not run the mutants from the description, and I did not run a game, so I cannot say which of the three causes a real run reports. The extra readability pass on the refusal path was not timed.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7197203588 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2836#issuecomment-7197203588). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-26T16:07:02Z. --- Hardware and WARP result for head `a243e5b4c1f0bf84166274315561bc880fec2fe3`: all pass. Part of #870. **Environment:** Windows 11 25H2 (26200), MSVC 19.42, `dev` preset, NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135). Tests run serially, one ctest process. **Command** ``` ctest --preset dev --no-tests=error -R "startup_memory_srv|slot70|startup_address_srv|address_buffer_srv|address_volume_srv|startup_triage|runtime_startup_triage" ``` **Result (measured):** 31/31 passed, exit code 0. - `startup_memory_srv_census` (the pure function `texture_unavailable_cause`). - `startup_address_srv`, `startup_address_volume_srv` and `startup_memory_srv_diag`, WARP and hardware (these read the new `texture_no_resource` and `texture_unreadable` names). - `startup_triage_run` and `runtime_startup_triage_run_cli_check` (`SLOT70_REASONS`). - The rest of the slot-70 group: `startup_memory_srv_{report,buffer,as,volume}` with controls, `dxr_slot70_as` (WARP and hardware), `startup_address_buffer_srv` (WARP and hardware). **What this shows:** the renamed refusal causes read correctly on an NVIDIA adapter and nothing else in the slot-70 group changed. **What this does not show:** I did not run the mutants from the description, and I did not run a game, so I cannot say which of the three causes a real run reports. The extra readability pass on the refusal path was not timed. AI-Assisted
pigalot commented 2026-11-27 19:36:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T19:36:02Z.

Review: APPROVED


Independently reviewed a243e5b4 integrated over main 6057071b (tree 76d5b436, clean merge).

What I traced. I checked the published flag at the second call site against the code above it. It is true exactly when publish_tiled_texture was reached:

  • the BC and bc64 views, through the ternary;
  • the console-layout views that had no live texture and no hold.

Every other view only went through existing_memory_texture, so texture_no_resource is right there. That name also covers a live resource with a different description, or two matches at the same base, which the docs line covers with "base and description".

The single-element site always attempted publication, so true is right there. address_texture_bytes and the readable probe now run a second time, but only on the refusal path, and the probe is skipped above 64 MiB as the unit test checks. Inserting the three names in the middle of memory_srv_reasons is safe: the census indexes by name through memory_srv_reason_index, and the counts are sized by memory_srv_reason_count.

What I ran. I built startup_stream_consumer, startup_memory_srv_census_check and d3d12_xs_shim in dev and release, then ran:
ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(startup_memory_srv_census|startup_address_srv_(warp|hardware)|startup_resource_address_index_missing_control_warp|startup_memory_srv_diag_(warp|hardware)|startup_memory_srv_diag_supported_control_warp|startup_address_volume_srv_(warp|hardware)|startup_address_single_element_(warp|hardware)|startup_triage_run)$'
12/12 passed in Debug and Release /O2, with no skips.

Mutant. I passed true for published at the second call site, as if every view had attempted publication. That fails two tests on WARP:

  • startup_address_srv_warp fails at reason=texture_unavailable res{dim=3 fmt=61 size=1x2x1 ...} (expected texture_no_resource);
  • startup_address_volume_srv_warp fails the same way on its res{dim=4 fmt=28 size=4x4x2 ...} line.

Restored, both pass. git diff --check is clean.

Non-blocking notes.

  • startup_address_volume_srv_check.py accepts texture_(?:no_resource|unreadable). The run only ever emits texture_no_resource: pinning the regex to that passes, and pinning it to texture_unreadable fails on that line. The exact name would keep the check as strict as it was before.
  • Only the census unit test reaches texture_unreadable and texture_over_64mib. No draw test does.

Verdict: approve on a243e5b4.

Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088; WARP 10.0.26100.9818; Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; debug layer on.
CI: Build and test on Windows passes on a243e5b4. There are no review threads.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6092658017 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2836#pullrequestreview-6092658017). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T19:36:02Z. **Review:** APPROVED --- Independently reviewed `a243e5b4` integrated over `main` `6057071b` (tree `76d5b436`, clean merge). **What I traced.** I checked the `published` flag at the second call site against the code above it. It is true exactly when `publish_tiled_texture` was reached: - the BC and `bc64` views, through the ternary; - the console-layout views that had no live texture and no hold. Every other view only went through `existing_memory_texture`, so `texture_no_resource` is right there. That name also covers a live resource with a different description, or two matches at the same base, which the docs line covers with "base and description". The single-element site always attempted publication, so `true` is right there. `address_texture_bytes` and the readable probe now run a second time, but only on the refusal path, and the probe is skipped above 64 MiB as the unit test checks. Inserting the three names in the middle of `memory_srv_reasons` is safe: the census indexes by name through `memory_srv_reason_index`, and the counts are sized by `memory_srv_reason_count`. **What I ran.** I built `startup_stream_consumer`, `startup_memory_srv_census_check` and `d3d12_xs_shim` in `dev` and `release`, then ran: `ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(startup_memory_srv_census|startup_address_srv_(warp|hardware)|startup_resource_address_index_missing_control_warp|startup_memory_srv_diag_(warp|hardware)|startup_memory_srv_diag_supported_control_warp|startup_address_volume_srv_(warp|hardware)|startup_address_single_element_(warp|hardware)|startup_triage_run)$'` 12/12 passed in Debug and Release `/O2`, with no skips. **Mutant.** I passed `true` for `published` at the second call site, as if every view had attempted publication. That fails two tests on WARP: - `startup_address_srv_warp` fails at `reason=texture_unavailable res{dim=3 fmt=61 size=1x2x1 ...}` (expected `texture_no_resource`); - `startup_address_volume_srv_warp` fails the same way on its `res{dim=4 fmt=28 size=4x4x2 ...}` line. Restored, both pass. `git diff --check` is clean. **Non-blocking notes.** - `startup_address_volume_srv_check.py` accepts `texture_(?:no_resource|unreadable)`. The run only ever emits `texture_no_resource`: pinning the regex to that passes, and pinning it to `texture_unreadable` fails on that line. The exact name would keep the check as strict as it was before. - Only the census unit test reaches `texture_unreadable` and `texture_over_64mib`. No draw test does. **Verdict:** approve on `a243e5b4`. Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088; WARP 10.0.26100.9818; Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; debug layer on. CI: `Build and test on Windows` passes on `a243e5b4`. There are no review threads. This reply was AI-assisted.
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!2828
No description provided.