runtime: report unavailable fixed mesh PSOs at creation when opted in #2265

Merged
R0Y00 merged 2 commits from upstream-pr/2273 into main 2026-11-25 10:04:18 +00:00
R0Y00 commented 2026-11-25 09:10:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T09:10:24Z.


Refs #1760 and #2253.

With X2W_REFUSE_FIXED_MESH=1, slot 57 returns E_NOTIMPL and clears the output for a fixed descriptor with a registered root, no VS, and a readable MS span of 16 bytes through 64 KiB. A PS can be absent or use the same bounds. Callers that handle the result can select a different creation path. With the switch unset, the existing placeholder is returned. Ordinary VS+PS and malformed fixed descriptors retain the legacy result, and an unsupported IID still takes precedence with E_NOINTERFACE.

cmake --build --preset release --target startup_indirect_draw_indexed
ctest --preset release --no-tests=error -j 1 -R '^startup_indirect_(mesh_|draw(_indexed)?_(warp|hardware))' -V

Release passed 14/14 tests without skips on Windows 11 build 26200.9974. The debug layer was enabled on WARP 10.0.26100.9818 and NVIDIA GeForce RTX 4060 Laptop GPU 32.0.16.1656. The fixture checks paired and MS-only creation with the switch on and off, exact HRESULT and output-pointer behavior, a wrong IID, normal VS+PS, and malformed spans and roots. The existing request and dispatch fixtures also passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6601027654 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2273). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T09:10:24Z. --- Refs #1760 and #2253. With `X2W_REFUSE_FIXED_MESH=1`, slot 57 returns `E_NOTIMPL` and clears the output for a fixed descriptor with a registered root, no VS, and a readable MS span of 16 bytes through 64 KiB. A PS can be absent or use the same bounds. Callers that handle the result can select a different creation path. With the switch unset, the existing placeholder is returned. Ordinary VS+PS and malformed fixed descriptors retain the legacy result, and an unsupported IID still takes precedence with `E_NOINTERFACE`. ```powershell cmake --build --preset release --target startup_indirect_draw_indexed ctest --preset release --no-tests=error -j 1 -R '^startup_indirect_(mesh_|draw(_indexed)?_(warp|hardware))' -V ``` Release passed 14/14 tests without skips on Windows 11 build 26200.9974. The debug layer was enabled on WARP 10.0.26100.9818 and NVIDIA GeForce RTX 4060 Laptop GPU 32.0.16.1656. The fixture checks paired and MS-only creation with the switch on and off, exact HRESULT and output-pointer behavior, a wrong IID, normal VS+PS, and malformed spans and roots. The existing request and dispatch fixtures also passed.
tedin7 commented 2026-11-25 09:13:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T09:13:47Z.

Review: COMMENTED


Review of head 57dc4b3ff8 (read-only pass, no Windows run by me).

Scope read: git diff --stat origin/main...HEAD shows 4 files (CMakeLists.txt, docs/experiments.md, src/startup_stubs/d3d12_xs_device.cpp, tests/startup_indirect_draw_indexed.cpp), 114 insertions, 7 deletions. Title is neutral, PR is mergeable, one commit.

Commands executed locally:

  • python3 tests/docs_links_check.py -> self-test passed, 18 Markdown files and 433 links checked.
  • python3 tests/bidi_controls_check.py -> self-test passed, 1562 files, no bidirectional controls.
  • git diff --check origin/main...HEAD -> clean.

Findings

  • P1: none.
  • P2: none.
  • nit (src/startup_stubs/d3d12_xs_device.cpp, device_create_pipeline_placeholder): the IID check now runs before the placeholder log, so a wrong-IID call no longer logs the first two placeholder lines. Behavior is unchanged and this seems intended. Worth one doc sentence only if someone greps those logs.
  • nit (is_fixed_mesh57_descriptor): the bounds lambda duplicates the 16-byte to 64-KiB span rule. Please confirm request_slot57_mesh in d3d12_draw.inl uses the same limits. If it doesn't, the two can drift, so a shared constant would be safer.
  • nit (CMakeLists.txt): startup_indirect_mesh_create_result_* is registered before the set_tests_properties for ..._request_*. This is harmless, but the property blocks could be grouped.

What I checked by reading

  • The opt-in is gated by X2W_REFUSE_FIXED_MESH, so the default path still returns the placeholder.
  • The E_POINTER and null-output clearing order is unchanged, and the output is cleared before E_NOTIMPL.
  • Unsupported IID returns E_NOINTERFACE ahead of the refusal.
  • The descriptor predicate needs a registered root signature kind, VS ptr and len both zero, a readable MS span of 16 to 65536 bytes, and a PS span that is either fully absent or equally bounded.
  • The fixture covers each of those branches: wrong root kind, missing root, VS ptr, VS len, MS ptr/len, unreadable spans, PS ptr/len, null and unreadable descriptors, and the default vs opt-in matrix.

Limits of this review

  • I did not run the C++ fixture. It is Windows-only (D3D12), and I did not request a Win2025 run. The mutation step was therefore not done. I only read the test matrix and judged that it would kill dropping the root-kind, VS-empty or span-bound conditions. Please treat that as unproven until the Windows job is green.
  • CI at review time: the Linux Python checks job and the gfx1013 job (step "Check machine-code inputs with LLVM 15") are failing, and the Windows job was still running. The PR touches no Python or assembly fixtures, so these look unrelated to the diff, but I could not read the logs. Please confirm with a rerun or against main before merging.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6054728181 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2273#pullrequestreview-6054728181). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T09:13:47Z. **Review:** COMMENTED --- Review of head 57dc4b3ff8248a3eca348d88b57a55d38966042e (read-only pass, no Windows run by me). **Scope read:** `git diff --stat origin/main...HEAD` shows 4 files (CMakeLists.txt, docs/experiments.md, src/startup_stubs/d3d12_xs_device.cpp, tests/startup_indirect_draw_indexed.cpp), 114 insertions, 7 deletions. Title is neutral, PR is mergeable, one commit. **Commands executed locally:** - `python3 tests/docs_links_check.py` -> self-test passed, 18 Markdown files and 433 links checked. - `python3 tests/bidi_controls_check.py` -> self-test passed, 1562 files, no bidirectional controls. - `git diff --check origin/main...HEAD` -> clean. **Findings** - P1: none. - P2: none. - nit (`src/startup_stubs/d3d12_xs_device.cpp`, `device_create_pipeline_placeholder`): the IID check now runs before the placeholder log, so a wrong-IID call no longer logs the first two placeholder lines. Behavior is unchanged and this seems intended. Worth one doc sentence only if someone greps those logs. - nit (`is_fixed_mesh57_descriptor`): the bounds lambda duplicates the 16-byte to 64-KiB span rule. Please confirm `request_slot57_mesh` in `d3d12_draw.inl` uses the same limits. If it doesn't, the two can drift, so a shared constant would be safer. - nit (`CMakeLists.txt`): `startup_indirect_mesh_create_result_*` is registered before the `set_tests_properties` for `..._request_*`. This is harmless, but the property blocks could be grouped. **What I checked by reading** - The opt-in is gated by `X2W_REFUSE_FIXED_MESH`, so the default path still returns the placeholder. - The E_POINTER and null-output clearing order is unchanged, and the output is cleared before E_NOTIMPL. - Unsupported IID returns E_NOINTERFACE ahead of the refusal. - The descriptor predicate needs a registered root signature kind, VS ptr and len both zero, a readable MS span of 16 to 65536 bytes, and a PS span that is either fully absent or equally bounded. - The fixture covers each of those branches: wrong root kind, missing root, VS ptr, VS len, MS ptr/len, unreadable spans, PS ptr/len, null and unreadable descriptors, and the default vs opt-in matrix. **Limits of this review** - I did not run the C++ fixture. It is Windows-only (D3D12), and I did not request a Win2025 run. The mutation step was therefore not done. I only read the test matrix and judged that it would kill dropping the root-kind, VS-empty or span-bound conditions. Please treat that as unproven until the Windows job is green. - CI at review time: the Linux Python checks job and the gfx1013 job (step "Check machine-code inputs with LLVM 15") are failing, and the Windows job was still running. The PR touches no Python or assembly fixtures, so these look unrelated to the diff, but I could not read the logs. Please confirm with a rerun or against main before merging. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 09:46:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T09:46:55Z.

Review: COMMENTED


Re-review of head d789ac715e366377e43761161adef1c0f47fbc2c (previous review: 57dc4b3f).

What changed: the new head is only a merge of main into the branch. The PR's own diff against main is still 4 files, +114/-7: CMakeLists.txt, docs/experiments.md, src/startup_stubs/d3d12_xs_device.cpp and tests/startup_indirect_draw_indexed.cpp. Merge state is MERGEABLE.

Commands run locally on the worktree:

  • git diff --stat origin/main...HEAD: 4 files, +114/-7, as above.
  • git diff --check origin/main...HEAD: clean.
  • python3 tests/docs_links_check.py: self-test passed, 18 Markdown files and 435 links checked.
  • python3 tests/bidi_controls_check.py: self-test passed, 1576 files, no bidirectional controls.
  • gh pr checks 2273: Linux Python checks pass, Windows build and test pass, gfx1013 fixtures pass. The /O2 Windows job and the chart publish job are skipped by design, and nothing fails.

Code read (targeted):

  • is_fixed_mesh57_descriptor only matches when all of these hold:

    • the root is a registered root-signature object;
    • the VS words (9, 10) are empty;
    • the MS span is readable and 16 B to 64 KiB;
    • the PS span is either absent or within the same bounds.

    Anything else keeps the old placeholder result. The default, with the switch unset, is unchanged.

  • Moving the IID check before the refusal is correct: a wrong IID gives E_NOINTERFACE and never E_NOTIMPL. The output pointer is cleared on every early return, and the null out and iid checks come first.

  • The test fixture covers the cases I would want:

    • the switch off and on;
    • MS+PS and MS-only;
    • a wrong IID;
    • a VS+PS descriptor, null and unreadable descriptors;
    • a wrong root kind, a missing root and a populated VS;
    • a missing, unreadable, oversized or truncated MS span;
    • PS spans that are half-set or unreadable;
    • a null ppv, which gives E_POINTER.

    It checks the HRESULT and the output pointer together.

  • The ctest entries use SKIP_RETURN_CODE 77 and a 30 s timeout, like the sibling tests. The fixture skips the mesh-capability probe so it runs on any adapter. The docs line and the ctest regex in docs/experiments.md are updated to match.

Findings: P1=0, P2=0.

  • nit: startup_indirect_mesh_create_result_* runs the same command as startup_indirect_mesh_request_* and differs only by the environment variable. That is fine, but a short comment next to it in CMakeLists.txt would help readers.
  • nit: the descriptor word indices (0, 5, 6, 9, 10, 13, 14) are bare numbers in both the stub and the test. Named constants shared with request_slot57_mesh would stop the two copies drifting apart.

Mutation: not run. The new logic is Windows-only D3D12 code and the new test needs a Windows runtime, so I could not build or execute it on this Linux host. I checked by reading that dropping the VS-empty, root-kind or span-bound clause would fail the matching field(...) or wrong_root control. I did not run a Windows build. The Windows CI job at this head passes, and I ran no Win2025 job myself.

No blockers from my side.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6055229183 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2273#pullrequestreview-6055229183). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T09:46:55Z. **Review:** COMMENTED --- Re-review of head `d789ac715e366377e43761161adef1c0f47fbc2c` (previous review: `57dc4b3f`). **What changed:** the new head is only a merge of `main` into the branch. The PR's own diff against `main` is still 4 files, +114/-7: `CMakeLists.txt`, `docs/experiments.md`, `src/startup_stubs/d3d12_xs_device.cpp` and `tests/startup_indirect_draw_indexed.cpp`. Merge state is MERGEABLE. **Commands run locally on the worktree:** - `git diff --stat origin/main...HEAD`: 4 files, +114/-7, as above. - `git diff --check origin/main...HEAD`: clean. - `python3 tests/docs_links_check.py`: self-test passed, 18 Markdown files and 435 links checked. - `python3 tests/bidi_controls_check.py`: self-test passed, 1576 files, no bidirectional controls. - `gh pr checks 2273`: Linux Python checks pass, Windows build and test pass, gfx1013 fixtures pass. The `/O2` Windows job and the chart publish job are skipped by design, and nothing fails. **Code read (targeted):** - `is_fixed_mesh57_descriptor` only matches when all of these hold: - the root is a registered root-signature object; - the VS words (9, 10) are empty; - the MS span is readable and 16 B to 64 KiB; - the PS span is either absent or within the same bounds. Anything else keeps the old placeholder result. The default, with the switch unset, is unchanged. - Moving the IID check before the refusal is correct: a wrong IID gives `E_NOINTERFACE` and never `E_NOTIMPL`. The output pointer is cleared on every early return, and the null `out` and `iid` checks come first. - The test fixture covers the cases I would want: - the switch off and on; - MS+PS and MS-only; - a wrong IID; - a VS+PS descriptor, null and unreadable descriptors; - a wrong root kind, a missing root and a populated VS; - a missing, unreadable, oversized or truncated MS span; - PS spans that are half-set or unreadable; - a null `ppv`, which gives `E_POINTER`. It checks the HRESULT and the output pointer together. - The ctest entries use `SKIP_RETURN_CODE 77` and a 30 s timeout, like the sibling tests. The fixture skips the mesh-capability probe so it runs on any adapter. The docs line and the ctest regex in `docs/experiments.md` are updated to match. **Findings:** P1=0, P2=0. - nit: `startup_indirect_mesh_create_result_*` runs the same command as `startup_indirect_mesh_request_*` and differs only by the environment variable. That is fine, but a short comment next to it in `CMakeLists.txt` would help readers. - nit: the descriptor word indices (0, 5, 6, 9, 10, 13, 14) are bare numbers in both the stub and the test. Named constants shared with `request_slot57_mesh` would stop the two copies drifting apart. **Mutation:** not run. The new logic is Windows-only D3D12 code and the new test needs a Windows runtime, so I could not build or execute it on this Linux host. I checked by reading that dropping the VS-empty, root-kind or span-bound clause would fail the matching `field(...)` or `wrong_root` control. I did not run a Windows build. The Windows CI job at this head passes, and I ran no Win2025 job myself. No blockers from my side. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 10:05:25 +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!2265
No description provided.