startup: count null descriptor bindings by cause #1250
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1257"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T05:43:58Z.
What
null bindingstotal 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.null bindings %ldtext in thex2w-render totalsline. The per-cause counts follow it in parentheses.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_checknow 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.Why
Refs #1146 (second done-when item only; the texture upload cache is not part of this change).
Tested
python3 -B tests/docs_links_check.pyandpython3 -B tests/bidi_controls_check.pypassed.ctest --preset dev --no-tests=error -R '^startup_null_views_warp$' -Vctest --preset release --no-tests=error -R '^startup_null_views_warp$' -VImported 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
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".
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:03:32Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:03:34Z.
Review: COMMENTED
No description provided.
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)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.
0012e8eℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
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)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 31With
X2W_DRAW_NULL_IDENTITY=1(enabled by the launcher attools/startup/run.ps1:49), an unreadable table entry or unknown token can be replaced successfully by the identity upload, leavingbuffer_facts.bound == true. These early returns nevertheless report a null cause, so the call afterbuffer_viewincrementsnull bindingsandentry/tokeneven though a non-null upload-ring SRV was bound; the oldif (!have)counter did not. Check a buffer's finalboundstate before classifying its source failure so the existing total keeps its meaning.Useful? React with 👍 / 👎.
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 2499When
queue_presentlogs while another thread records a translated draw, these arguments do not form a consistent snapshot:count_null_bindingincrements the total and its cause separately, and this logging block reads them withoutdraw_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 samedraw_lockused bydraw_translated, then format the snapshot.Useful? React with 👍 / 👎.
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 31Fixed in
5579c35a:classify_null_bindingreturns none for any buffer whose final state is bound, so an identity-fallback upload is no longer counted in the total or inentry/token; the oldif (!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.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 2499Fixed in
5579c35a:queue_presentcopies the total and the five causes while holdingdraw_lock, whichdraw_translatedholds 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).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:--preset dev):ctest --preset dev -R "^startup_null_views_warp$"— 1/1 PASS (0.06s)/O2(--preset release):ctest --preset release -R "^startup_null_views_warp$"— 1/1 PASS (0.06s)Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:23:00Z.
Re-verified after rebase onto
mainon Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commitd9d8b46af94a8306e1398a42ae7512c9af98a018:--preset dev):startup_null_views_checkbuild26.00s;ctest --preset dev -R '^startup_null_views_warp$' --no-tests=error --output-on-failure: 1/1 passed (0.06s)/O2(--preset release):startup_null_views_checkbuild38.28s;ctest --preset release -R '^startup_null_views_warp$' --no-tests=error --output-on-failure: 1/1 passed (0.06s)