startup: count null descriptor bindings by cause #1250

Merged
tedin7 merged 2 commits from upstream-pr/1257 into main 2026-11-24 08:25:07 +00:00
tedin7 commented 2026-11-24 05:43:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T05:43:58Z.


What

  • Splits the null bindings total in the translated draw path into five causes: null or unreadable table entry, unreadable buffer address or size (including a failed frame copy), unknown view token, missing or non-resource texture wrapper, view-dimension mismatch.
  • The existing total keeps its meaning and its null bindings %ld text in the x2w-render totals line. The per-cause counts follow it in parentheses.
  • Fixes an uncounted case: the dimension-mismatch path cleared the texture without counting it. It is now counted, in the total and in its cause.
  • Each binding is classified once by a pure function (src/startup_stubs/null_binding_cause.h), so the causes always sum to the total and a missing wrapper is not counted again as a mismatch.
  • startup_null_views_check now also runs pure cases for every cause, the sum equals the total, and valid bindings add nothing. The fixture cannot read the live counters (it never draws), so the classification is what is tested.
  • docs/startup-runtime.md describes the new figures.

Why

Refs #1146 (second done-when item only; the texture upload cache is not part of this change).

Tested

  • Run on Linux: the pure cause cases compiled with g++ -std=c++17 -Wall -Wextra and passed; python3 -B tests/docs_links_check.py and python3 -B tests/bidi_controls_check.py passed.
  • NOT run: any MSVC or D3D12 build, including the edits in d3d12_draw.inl and d3d12_xs_device.cpp and the updated fixture. No translated draw was run, so the live counts are unverified.
  • Windows commands to run:
    • ctest --preset dev --no-tests=error -R '^startup_null_views_warp$' -V
    • ctest --preset release --no-tests=error -R '^startup_null_views_warp$' -V
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6575488601 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T05:43:58Z. --- ## What - Splits the `null bindings` total in the translated draw path into five causes: null or unreadable table entry, unreadable buffer address or size (including a failed frame copy), unknown view token, missing or non-resource texture wrapper, view-dimension mismatch. - The existing total keeps its meaning and its `null bindings %ld` text in the `x2w-render totals` line. The per-cause counts follow it in parentheses. - Fixes an uncounted case: the dimension-mismatch path cleared the texture without counting it. It is now counted, in the total and in its cause. - Each binding is classified once by a pure function (`src/startup_stubs/null_binding_cause.h`), so the causes always sum to the total and a missing wrapper is not counted again as a mismatch. - `startup_null_views_check` now also runs pure cases for every cause, the sum equals the total, and valid bindings add nothing. The fixture cannot read the live counters (it never draws), so the classification is what is tested. - docs/startup-runtime.md describes the new figures. ## Why Refs #1146 (second done-when item only; the texture upload cache is not part of this change). ## Tested - Run on Linux: the pure cause cases compiled with g++ -std=c++17 -Wall -Wextra and passed; `python3 -B tests/docs_links_check.py` and `python3 -B tests/bidi_controls_check.py` passed. - NOT run: any MSVC or D3D12 build, including the edits in d3d12_draw.inl and d3d12_xs_device.cpp and the updated fixture. No translated draw was run, so the live counts are unverified. - Windows commands to run: - `ctest --preset dev --no-tests=error -R '^startup_null_views_warp$' -V` - `ctest --preset release --no-tests=error -R '^startup_null_views_warp$' -V`
chatgpt-codex-connector[bot commented 2026-11-24 06:47:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T06:00:12Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0012e8ea1a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6034416307 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#pullrequestreview-6034416307). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T06:00:12Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `0012e8ea1a` <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". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-24 06:47:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:03:32Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6034446467 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#pullrequestreview-6034446467). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T06:03:32Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-24 06:47:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:03:34Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6034446851 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#pullrequestreview-6034446851). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T06:03:34Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-24 06:50:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T05:55:23Z.


Verified on Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP) at 0012e8ea:

  • ctest --preset dev -R "^startup_null_views_warp$" — 1/1 PASS (0.14s)
  • ctest --preset release -R "^startup_null_views_warp$" (/O2) — 1/1 PASS (0.14s)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7123402280 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#issuecomment-7123402280). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T05:55:23Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP) at `0012e8ea`: - `ctest --preset dev -R "^startup_null_views_warp$"` — **1/1 PASS** (`0.14s`) - `ctest --preset release -R "^startup_null_views_warp$"` (`/O2`) — **1/1 PASS** (`0.14s`)
chatgpt-codex-connector[bot commented 2026-11-24 06:50:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T05:55:37Z.


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-24T06:00:15.542978Z 0012e8e 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:7123406078 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#issuecomment-7123406078). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T05:55:37Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"0012e8ea1a735104547a1e4c521f11eac9d3e731","has_any_findings":true,"has_unresolved_findings":true,"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-24T06:00:15.542978Z">2026-11-24T06:00:15.542978Z</relative-time> | `0012e8e` | 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>
tedin7 commented 2026-11-24 06:50:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:07:58Z.


Verified on Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP) at 5579c35a:

  • cmake --preset dev + cmake --build --preset dev --target startup_null_views_check + ctest --preset dev -R "^startup_null_views_warp$" — 1/1 PASS (0.07s)
  • cmake --preset release + cmake --build --preset release --target startup_null_views_check (/O2) + ctest --preset release -R "^startup_null_views_warp$" — 1/1 PASS (0.10s)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7123616735 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#issuecomment-7123616735). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T06:07:58Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP) at `5579c35a`: - `cmake --preset dev` + `cmake --build --preset dev --target startup_null_views_check` + `ctest --preset dev -R "^startup_null_views_warp$"` — **1/1 PASS** (`0.07s`) - `cmake --preset release` + `cmake --build --preset release --target startup_null_views_check` (`/O2`) + `ctest --preset release -R "^startup_null_views_warp$"` — **1/1 PASS** (`0.10s`)
chatgpt-codex-connector[bot commented 2026-11-24 06:50:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T06:00:12Z.

Code review location: src/startup_stubs/null_binding_cause.h; line 31

@@ -0,0 +1,39 @@
+#pragma once
+
+namespace x2w_local {
+// Why a translated draw bound a null descriptor. Each null binding has exactly one cause, so the
+// per-cause counts add up to the null_bindings total.
+enum class NullCause : int {
+    none = -1,
+    table_entry,         // table entry is null, empty or unreadable
+    buffer_unreadable,   // buffer address or size missing or unreadable, or the frame copy failed
+    unknown_token,       // descriptor memory names a view the wrapper does not know
+    texture_wrapper,     // the view's resource is missing or is not a resource wrapper
+    dimension_mismatch,  // the view dimension does not match the shader
+};
+constexpr int null_cause_count = 5;
+constexpr const char* null_cause_names[null_cause_count] = {"entry", "buffer", "token", "wrapper", "dimension"};
+
+struct BindingFacts {
+    bool texture = false;
+    bool from_table = false;          // the descriptor comes from a descriptor table entry
+    bool entry_readable = false;      // that entry is present and readable
+    bool token_magic = false;         // its first word marks a wrapper-made view
+    bool token_known = false;         // and the view id is one the wrapper issued
+    bool resource_wrapper = false;    // texture: the view resolves to a resource wrapper
+    bool dimension_matches = true;    // texture: the view dimension suits the shader
+    bool bound = false;               // buffer: a readable range was bound
+};
+
+inline NullCause classify_null_binding(const BindingFacts& f)
+{
+    if (f.from_table && !f.entry_readable) return NullCause::table_entry;
+    if (f.from_table && f.token_magic && !f.token_known) return NullCause::unknown_token;

P2 Badge Exclude successful identity fallbacks from the null counts

With X2W_DRAW_NULL_IDENTITY=1 (enabled by the launcher at tools/startup/run.ps1:49), an unreadable table entry or unknown token can be replaced successfully by the identity upload, leaving buffer_facts.bound == true. These early returns nevertheless report a null cause, so the call after buffer_view increments null bindings and entry/token even though a non-null upload-ring SRV was bound; the old if (!have) counter did not. Check a buffer's final bound state before classifying its source failure so the existing total keeps its meaning.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4676108111 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#discussion_r4676108111). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T06:00:12Z. **Code review location:** `src/startup_stubs/null_binding_cause.h`; line 31 ~~~~diff @@ -0,0 +1,39 @@ +#pragma once + +namespace x2w_local { +// Why a translated draw bound a null descriptor. Each null binding has exactly one cause, so the +// per-cause counts add up to the null_bindings total. +enum class NullCause : int { + none = -1, + table_entry, // table entry is null, empty or unreadable + buffer_unreadable, // buffer address or size missing or unreadable, or the frame copy failed + unknown_token, // descriptor memory names a view the wrapper does not know + texture_wrapper, // the view's resource is missing or is not a resource wrapper + dimension_mismatch, // the view dimension does not match the shader +}; +constexpr int null_cause_count = 5; +constexpr const char* null_cause_names[null_cause_count] = {"entry", "buffer", "token", "wrapper", "dimension"}; + +struct BindingFacts { + bool texture = false; + bool from_table = false; // the descriptor comes from a descriptor table entry + bool entry_readable = false; // that entry is present and readable + bool token_magic = false; // its first word marks a wrapper-made view + bool token_known = false; // and the view id is one the wrapper issued + bool resource_wrapper = false; // texture: the view resolves to a resource wrapper + bool dimension_matches = true; // texture: the view dimension suits the shader + bool bound = false; // buffer: a readable range was bound +}; + +inline NullCause classify_null_binding(const BindingFacts& f) +{ + if (f.from_table && !f.entry_readable) return NullCause::table_entry; + if (f.from_table && f.token_magic && !f.token_known) return NullCause::unknown_token; ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Exclude successful identity fallbacks from the null counts** With `X2W_DRAW_NULL_IDENTITY=1` (enabled by the launcher at `tools/startup/run.ps1:49`), an unreadable table entry or unknown token can be replaced successfully by the identity upload, leaving `buffer_facts.bound == true`. These early returns nevertheless report a null cause, so the call after `buffer_view` increments `null bindings` and `entry`/`token` even though a non-null upload-ring SRV was bound; the old `if (!have)` counter did not. Check a buffer's final `bound` state before classifying its source failure so the existing total keeps its meaning. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-24 06:50:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T06:00:12Z.

Code review location: src/startup_stubs/d3d12_xs_device.cpp; line 2499

@@ -2491,10 +2492,11 @@ HRESULT __stdcall queue_present(Wrapper* self, UINT planes, const void* plane_pa
     }
     if (render_mode() && frame % 300 == 0)
         log("x2w-render totals: resets %ld (failed %ld), closes %ld, clears %ld, executes %ld, draws %ld (skipped %ld), "
-            "translated draws %ld (not drawn %ld), pipelines translated %ld / missing %ld, null bindings %ld, textures uploaded %ld "
-            "(%ld KiB, unreadable %ld)", render_resets,
+            "translated draws %ld (not drawn %ld), pipelines translated %ld / missing %ld, null bindings %ld (entry %ld, buffer %ld, token %ld, wrapper %ld, dimension %ld), "
+            "textures uploaded %ld (%ld KiB, unreadable %ld)", render_resets,
             render_reset_failures, render_closes, render_clears, render_executes, render_draws, render_draws_skipped,
-            translated_draws, untranslated_draws, translation_ready, translation_missing, null_bindings, textures_uploaded,
+            translated_draws, untranslated_draws, translation_ready, translation_missing, null_bindings,
+            null_by_cause[0], null_by_cause[1], null_by_cause[2], null_by_cause[3], null_by_cause[4], textures_uploaded,

P2 Badge Read the total and cause counts from a synchronized snapshot

When queue_present logs while another thread records a translated draw, these arguments do not form a consistent snapshot: count_null_binding increments the total and its cause separately, and this logging block reads them without draw_lock. A present scheduled between those increments can therefore report a total of 1 with every cause still 0, violating the advertised sum invariant. Copy the total and all five cause counts while holding the same draw_lock used by draw_translated, then format the snapshot.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4676108122 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#discussion_r4676108122). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T06:00:12Z. **Code review location:** `src/startup_stubs/d3d12_xs_device.cpp`; line 2499 ~~~~diff @@ -2491,10 +2492,11 @@ HRESULT __stdcall queue_present(Wrapper* self, UINT planes, const void* plane_pa } if (render_mode() && frame % 300 == 0) log("x2w-render totals: resets %ld (failed %ld), closes %ld, clears %ld, executes %ld, draws %ld (skipped %ld), " - "translated draws %ld (not drawn %ld), pipelines translated %ld / missing %ld, null bindings %ld, textures uploaded %ld " - "(%ld KiB, unreadable %ld)", render_resets, + "translated draws %ld (not drawn %ld), pipelines translated %ld / missing %ld, null bindings %ld (entry %ld, buffer %ld, token %ld, wrapper %ld, dimension %ld), " + "textures uploaded %ld (%ld KiB, unreadable %ld)", render_resets, render_reset_failures, render_closes, render_clears, render_executes, render_draws, render_draws_skipped, - translated_draws, untranslated_draws, translation_ready, translation_missing, null_bindings, textures_uploaded, + translated_draws, untranslated_draws, translation_ready, translation_missing, null_bindings, + null_by_cause[0], null_by_cause[1], null_by_cause[2], null_by_cause[3], null_by_cause[4], textures_uploaded, ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Read the total and cause counts from a synchronized snapshot** When `queue_present` logs while another thread records a translated draw, these arguments do not form a consistent snapshot: `count_null_binding` increments the total and its cause separately, and this logging block reads them without `draw_lock`. A present scheduled between those increments can therefore report a total of 1 with every cause still 0, violating the advertised sum invariant. Copy the total and all five cause counts while holding the same `draw_lock` used by `draw_translated`, then format the snapshot. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-24 06:50:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:03:32Z.

Code review location: src/startup_stubs/null_binding_cause.h; line 31

@@ -0,0 +1,39 @@
+#pragma once
+
+namespace x2w_local {
+// Why a translated draw bound a null descriptor. Each null binding has exactly one cause, so the
+// per-cause counts add up to the null_bindings total.
+enum class NullCause : int {
+    none = -1,
+    table_entry,         // table entry is null, empty or unreadable
+    buffer_unreadable,   // buffer address or size missing or unreadable, or the frame copy failed
+    unknown_token,       // descriptor memory names a view the wrapper does not know
+    texture_wrapper,     // the view's resource is missing or is not a resource wrapper
+    dimension_mismatch,  // the view dimension does not match the shader
+};
+constexpr int null_cause_count = 5;
+constexpr const char* null_cause_names[null_cause_count] = {"entry", "buffer", "token", "wrapper", "dimension"};
+
+struct BindingFacts {
+    bool texture = false;
+    bool from_table = false;          // the descriptor comes from a descriptor table entry
+    bool entry_readable = false;      // that entry is present and readable
+    bool token_magic = false;         // its first word marks a wrapper-made view
+    bool token_known = false;         // and the view id is one the wrapper issued
+    bool resource_wrapper = false;    // texture: the view resolves to a resource wrapper
+    bool dimension_matches = true;    // texture: the view dimension suits the shader
+    bool bound = false;               // buffer: a readable range was bound
+};
+
+inline NullCause classify_null_binding(const BindingFacts& f)
+{
+    if (f.from_table && !f.entry_readable) return NullCause::table_entry;
+    if (f.from_table && f.token_magic && !f.token_known) return NullCause::unknown_token;

Fixed in 5579c35a: classify_null_binding returns none for any buffer whose final state is bound, so an identity-fallback upload is no longer counted in the total or in entry/token; the old if (!have) meaning is kept. The Linux-built cases now include an unreadable entry and an unknown token that end up bound (none), next to the unbound ones (counted). Without the change they fail. The draw path itself was not built or run by me.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4676130524 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#discussion_r4676130524). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T06:03:32Z. **Code review location:** `src/startup_stubs/null_binding_cause.h`; line 31 ~~~~diff @@ -0,0 +1,39 @@ +#pragma once + +namespace x2w_local { +// Why a translated draw bound a null descriptor. Each null binding has exactly one cause, so the +// per-cause counts add up to the null_bindings total. +enum class NullCause : int { + none = -1, + table_entry, // table entry is null, empty or unreadable + buffer_unreadable, // buffer address or size missing or unreadable, or the frame copy failed + unknown_token, // descriptor memory names a view the wrapper does not know + texture_wrapper, // the view's resource is missing or is not a resource wrapper + dimension_mismatch, // the view dimension does not match the shader +}; +constexpr int null_cause_count = 5; +constexpr const char* null_cause_names[null_cause_count] = {"entry", "buffer", "token", "wrapper", "dimension"}; + +struct BindingFacts { + bool texture = false; + bool from_table = false; // the descriptor comes from a descriptor table entry + bool entry_readable = false; // that entry is present and readable + bool token_magic = false; // its first word marks a wrapper-made view + bool token_known = false; // and the view id is one the wrapper issued + bool resource_wrapper = false; // texture: the view resolves to a resource wrapper + bool dimension_matches = true; // texture: the view dimension suits the shader + bool bound = false; // buffer: a readable range was bound +}; + +inline NullCause classify_null_binding(const BindingFacts& f) +{ + if (f.from_table && !f.entry_readable) return NullCause::table_entry; + if (f.from_table && f.token_magic && !f.token_known) return NullCause::unknown_token; ~~~~ --- Fixed in 5579c35a: `classify_null_binding` returns none for any buffer whose final state is bound, so an identity-fallback upload is no longer counted in the total or in `entry`/`token`; the old `if (!have)` meaning is kept. The Linux-built cases now include an unreadable entry and an unknown token that end up bound (none), next to the unbound ones (counted). Without the change they fail. The draw path itself was not built or run by me.
tedin7 commented 2026-11-24 06:50:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:03:34Z.

Code review location: src/startup_stubs/d3d12_xs_device.cpp; line 2499

@@ -2491,10 +2492,11 @@ HRESULT __stdcall queue_present(Wrapper* self, UINT planes, const void* plane_pa
     }
     if (render_mode() && frame % 300 == 0)
         log("x2w-render totals: resets %ld (failed %ld), closes %ld, clears %ld, executes %ld, draws %ld (skipped %ld), "
-            "translated draws %ld (not drawn %ld), pipelines translated %ld / missing %ld, null bindings %ld, textures uploaded %ld "
-            "(%ld KiB, unreadable %ld)", render_resets,
+            "translated draws %ld (not drawn %ld), pipelines translated %ld / missing %ld, null bindings %ld (entry %ld, buffer %ld, token %ld, wrapper %ld, dimension %ld), "
+            "textures uploaded %ld (%ld KiB, unreadable %ld)", render_resets,
             render_reset_failures, render_closes, render_clears, render_executes, render_draws, render_draws_skipped,
-            translated_draws, untranslated_draws, translation_ready, translation_missing, null_bindings, textures_uploaded,
+            translated_draws, untranslated_draws, translation_ready, translation_missing, null_bindings,
+            null_by_cause[0], null_by_cause[1], null_by_cause[2], null_by_cause[3], null_by_cause[4], textures_uploaded,

Fixed in 5579c35a: queue_present copies the total and the five causes while holding draw_lock, which draw_translated holds while it counts, and formats the copy. Only the null counters are snapshotted; the other counters on that line are unchanged. Not compiled by me (Windows headers).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4676130789 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#discussion_r4676130789). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T06:03:34Z. **Code review location:** `src/startup_stubs/d3d12_xs_device.cpp`; line 2499 ~~~~diff @@ -2491,10 +2492,11 @@ HRESULT __stdcall queue_present(Wrapper* self, UINT planes, const void* plane_pa } if (render_mode() && frame % 300 == 0) log("x2w-render totals: resets %ld (failed %ld), closes %ld, clears %ld, executes %ld, draws %ld (skipped %ld), " - "translated draws %ld (not drawn %ld), pipelines translated %ld / missing %ld, null bindings %ld, textures uploaded %ld " - "(%ld KiB, unreadable %ld)", render_resets, + "translated draws %ld (not drawn %ld), pipelines translated %ld / missing %ld, null bindings %ld (entry %ld, buffer %ld, token %ld, wrapper %ld, dimension %ld), " + "textures uploaded %ld (%ld KiB, unreadable %ld)", render_resets, render_reset_failures, render_closes, render_clears, render_executes, render_draws, render_draws_skipped, - translated_draws, untranslated_draws, translation_ready, translation_missing, null_bindings, textures_uploaded, + translated_draws, untranslated_draws, translation_ready, translation_missing, null_bindings, + null_by_cause[0], null_by_cause[1], null_by_cause[2], null_by_cause[3], null_by_cause[4], textures_uploaded, ~~~~ --- Fixed in 5579c35a: `queue_present` copies the total and the five causes while holding `draw_lock`, which `draw_translated` holds while it counts, and formats the copy. Only the null counters are snapshotted; the other counters on that line are unchanged. Not compiled by me (Windows headers).
upstream-sync closed this pull request 2026-11-24 09:04:21 +00:00
tedin7 commented 2026-11-24 09:04:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:09:22Z.


Re-verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP) after rebase at 291eb28e:

  • Debug (--preset dev): ctest --preset dev -R "^startup_null_views_warp$" — 1/1 PASS (0.06s)
  • Release /O2 (--preset release): ctest --preset release -R "^startup_null_views_warp$" — 1/1 PASS (0.06s)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7125791426 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#issuecomment-7125791426). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T08:09:22Z. --- Re-verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP) after rebase at `291eb28e`: - Debug (`--preset dev`): `ctest --preset dev -R "^startup_null_views_warp$"` — **1/1 PASS** (`0.06s`) - Release `/O2` (`--preset release`): `ctest --preset release -R "^startup_null_views_warp$"` — **1/1 PASS** (`0.06s`)
tedin7 commented 2026-11-24 09:04:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:23:00Z.


Re-verified after rebase onto main on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit d9d8b46af94a8306e1398a42ae7512c9af98a018:

  • Debug (--preset dev): startup_null_views_check build 26.00s; ctest --preset dev -R '^startup_null_views_warp$' --no-tests=error --output-on-failure: 1/1 passed (0.06s)
  • Release /O2 (--preset release): startup_null_views_check build 38.28s; ctest --preset release -R '^startup_null_views_warp$' --no-tests=error --output-on-failure: 1/1 passed (0.06s)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7126066745 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1257#issuecomment-7126066745). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T08:23:00Z. --- Re-verified after rebase onto `main` on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `d9d8b46af94a8306e1398a42ae7512c9af98a018`: - **Debug (`--preset dev`)**: `startup_null_views_check` build `26.00s`; `ctest --preset dev -R '^startup_null_views_warp$' --no-tests=error --output-on-failure`: **1/1 passed** (`0.06s`) - **Release `/O2` (`--preset release`)**: `startup_null_views_check` build `38.28s`; `ctest --preset release -R '^startup_null_views_warp$' --no-tests=error --output-on-failure`: **1/1 passed** (`0.06s`)
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!1250
No description provided.