gpu: opt-in descriptor history with heap-relative filtering (carries #3321 and #3772) #3891

Open
Leyukaka wants to merge 3 commits from upstream-pr/3891 into main
Leyukaka commented 2026-12-02 21:02:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-02T21:02:41Z.


Refs #3310. Supersedes #3321 and #3772, if their authors agree (see Landing order). Target main.

This branch carries the work of @wish131400 (#3321) and @Vilify-13 (#3772), rebased onto main bd72fae3d. The three original commits are kept with their authors, dates and messages unchanged; it adds no commit of ours.

Problem

#3321 adds an opt-in descriptor history and a GPU-written Mesh argument fixture. #3772 adds heap-relative filtering on top of it and carries #3321's commit. Both conflict with current main, and #3772's review has two open items: the landing order with #3321, which is still unanswered on #3321, and the rebase. Each rebase conflict sits in lines that #3321's commit touches, so the two cannot be rebased independently without one conflicting with the other.

Change

Commit Author Change
d468da90a @wish131400 Descriptor history and Mesh argument provenance fixture (#3321, 42a18553 + 029dfefe)
cd05d66b4 @Vilify-13 Targeted descriptor history filtering (#3772, 390f5c1d)
72ba1df20 @Vilify-13 Review follow-up: one cached off-path check, per-reason omission counters, full registry discovery (#3772, e2609c0e)
  • Off by default. With X2W_D3D12_DESCRIPTOR_HISTORY unset, note_view and note_copy call the same shadow_slot overloads as main; the filter variable is not read and no registry is built.
  • X2W_D3D12_DESCRIPTOR_HISTORY_FILTER takes up to two TYPE:VISIBILITY:NODE_MASK:CAPACITY:ORDINAL:FIRST:COUNT selectors and selects descriptor operations before they use the 8,192-record budget. Grammar and limits are in docs/experiments/descriptor-history-filter.md.
  • No GPU commands or synchronization are added.

The rebased diff equals the two PRs line by line, except for two mechanical conflict resolutions:

  • CMakePresets.json, pr test filter: keeps main's entries and adds this branch's (startup_mesh_argument_provenance_warp and startup_descriptor_history_(model|(filter|exhaustion|incomplete)_warp)).
  • tests/startup_indirect_draw_indexed.cpp, DrawKind::mesh condition: keeps the modes main added and adds mesh-provenance.

I found no logical conflict with #3725, #3776 or #3885.

Landing order

The three commits land together, in order: #3321's commit first, then #3772's two. This is the "close in favour of one PR" option from the #3772 review. It needs both authors' agreement, and I am asking on #3321 and #3772. If either author prefers to land their own PR, I will close this one.

Verification

Windows, on the same commits rebased onto bd72fae3d: 9 of 9 passed, GPU tests run serially. The branch was then rebased again onto 70d2679d7 without conflicts.

ctest --no-tests=error -j1 -V -R '^startup_(mesh_argument_provenance_(warp|hardware)|descriptor_history_(model|(filter|exhaustion|incomplete)_(warp|hardware)))$'
  • startup_mesh_argument_provenance_warp, startup_mesh_argument_provenance_hardware
  • startup_descriptor_history_model
  • startup_descriptor_history_filter_warp, startup_descriptor_history_filter_hardware
  • startup_descriptor_history_exhaustion_warp, startup_descriptor_history_exhaustion_hardware
  • startup_descriptor_history_incomplete_warp, startup_descriptor_history_incomplete_hardware

The mutation results reported in the #3772 review were not rerun on this head.

Known limitations

  • The disabled-path benchmark against main requested in the #3772 review (base against head, switch unset) was not run.
  • Inherited from #3321's review, not changed here:
    • Copy events record shadow ids only, not whether the guest copy ran or which guest token it carried.
    • Typed buffer SRVs log no byte range.
    • Unfiltered mode logs a copy from an untracked source as new=0, the same as copying an empty descriptor.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5614653876 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3891). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-12-02T21:02:41Z. --- Refs #3310. Supersedes #3321 and #3772, if their authors agree (see Landing order). Target `main`. This branch carries the work of @wish131400 (#3321) and @Vilify-13 (#3772), rebased onto `main` `bd72fae3d`. The three original commits are kept with their authors, dates and messages unchanged; it adds no commit of ours. ## Problem #3321 adds an opt-in descriptor history and a GPU-written Mesh argument fixture. #3772 adds heap-relative filtering on top of it and carries #3321's commit. Both conflict with current `main`, and #3772's review has two open items: the landing order with #3321, which is still unanswered on #3321, and the rebase. Each rebase conflict sits in lines that #3321's commit touches, so the two cannot be rebased independently without one conflicting with the other. ## Change | Commit | Author | Change | |---|---|---| | `d468da90a` | @wish131400 | Descriptor history and Mesh argument provenance fixture (#3321, `42a18553` + `029dfefe`) | | `cd05d66b4` | @Vilify-13 | Targeted descriptor history filtering (#3772, `390f5c1d`) | | `72ba1df20` | @Vilify-13 | Review follow-up: one cached off-path check, per-reason omission counters, full registry discovery (#3772, `e2609c0e`) | - Off by default. With `X2W_D3D12_DESCRIPTOR_HISTORY` unset, `note_view` and `note_copy` call the same `shadow_slot` overloads as `main`; the filter variable is not read and no registry is built. - `X2W_D3D12_DESCRIPTOR_HISTORY_FILTER` takes up to two `TYPE:VISIBILITY:NODE_MASK:CAPACITY:ORDINAL:FIRST:COUNT` selectors and selects descriptor operations before they use the 8,192-record budget. Grammar and limits are in `docs/experiments/descriptor-history-filter.md`. - No GPU commands or synchronization are added. The rebased diff equals the two PRs line by line, except for two mechanical conflict resolutions: - `CMakePresets.json`, `pr` test filter: keeps `main`'s entries and adds this branch's (`startup_mesh_argument_provenance_warp` and `startup_descriptor_history_(model|(filter|exhaustion|incomplete)_warp)`). - `tests/startup_indirect_draw_indexed.cpp`, `DrawKind::mesh` condition: keeps the modes `main` added and adds `mesh-provenance`. I found no logical conflict with #3725, #3776 or #3885. ## Landing order The three commits land together, in order: #3321's commit first, then #3772's two. This is the "close in favour of one PR" option from the #3772 review. It needs both authors' agreement, and I am asking on #3321 and #3772. If either author prefers to land their own PR, I will close this one. ## Verification Windows, on the same commits rebased onto `bd72fae3d`: 9 of 9 passed, GPU tests run serially. The branch was then rebased again onto `70d2679d7` without conflicts. ``` ctest --no-tests=error -j1 -V -R '^startup_(mesh_argument_provenance_(warp|hardware)|descriptor_history_(model|(filter|exhaustion|incomplete)_(warp|hardware)))$' ``` - `startup_mesh_argument_provenance_warp`, `startup_mesh_argument_provenance_hardware` - `startup_descriptor_history_model` - `startup_descriptor_history_filter_warp`, `startup_descriptor_history_filter_hardware` - `startup_descriptor_history_exhaustion_warp`, `startup_descriptor_history_exhaustion_hardware` - `startup_descriptor_history_incomplete_warp`, `startup_descriptor_history_incomplete_hardware` The mutation results reported in the #3772 review were not rerun on this head. ## Known limitations - The disabled-path benchmark against `main` requested in the #3772 review (base against head, switch unset) was not run. - Inherited from #3321's review, not changed here: - Copy events record shadow ids only, not whether the guest copy ran or which guest token it carried. - Typed buffer SRVs log no byte range. - Unfiltered mode logs a copy from an untracked source as `new=0`, the same as copying an empty descriptor.
R0Y00 commented 2026-12-02 21:15:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T21:15:39Z.

Review: COMMENTED


Independently tested 674c1f48 with MSVC Debug on Windows 11 build 26300. ctest --preset dev --no-tests=error -j 1 --output-on-failure -R '^startup_(mesh_argument_provenance_(warp|hardware)|descriptor_history_(model|(filter|exhaustion|incomplete)_(warp|hardware)))$' passed all nine cases. That includes the disabled/invalid filter cases, history budget and omission controls, and Mesh argument readback on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. This is fixture coverage. The disabled-path timing comparison and the two original authors' landing choices are still open.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6159154337 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3891#pullrequestreview-6159154337). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T21:15:39Z. **Review:** COMMENTED --- Independently tested `674c1f48` with MSVC Debug on Windows 11 build 26300. `ctest --preset dev --no-tests=error -j 1 --output-on-failure -R '^startup_(mesh_argument_provenance_(warp|hardware)|descriptor_history_(model|(filter|exhaustion|incomplete)_(warp|hardware)))$'` passed all nine cases. That includes the disabled/invalid filter cases, history budget and omission controls, and Mesh argument readback on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. This is fixture coverage. The disabled-path timing comparison and the two original authors' landing choices are still open.
R0Y00 commented 2026-12-03 06:53:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T06:53:28Z.


I ran the source-built startup_descriptor_history_check model at 674c1f48 with MSVC C++17. The 1,024-heap discovery, 100,000 randomized registry operations, 20,000 randomized admission operations and all nine omission reasons passed. I also checked the merge against main at 29bb2aed: the remaining textual conflict is CMakePresets.json. Please keep main’s build targets and smoke tests, then add startup_descriptor_history_check, startup_mesh_argument_provenance_warp, and startup_descriptor_history_(model|(filter|exhaustion|incomplete)_warp). The model result does not cover the previously requested disabled-path benchmark, and the two original PRs’ landing order is still being coordinated.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7370351688 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3891#issuecomment-7370351688). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T06:53:28Z. --- I ran the source-built `startup_descriptor_history_check` model at `674c1f48` with MSVC C++17. The 1,024-heap discovery, 100,000 randomized registry operations, 20,000 randomized admission operations and all nine omission reasons passed. I also checked the merge against `main` at `29bb2aed`: the remaining textual conflict is `CMakePresets.json`. Please keep main’s build targets and smoke tests, then add `startup_descriptor_history_check`, `startup_mesh_argument_provenance_warp`, and `startup_descriptor_history_(model|(filter|exhaustion|incomplete)_warp)`. The model result does not cover the previously requested disabled-path benchmark, and the two original PRs’ landing order is still being coordinated.
Not-Saii commented 2026-12-03 16:25:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-12-03T16:25:49Z.

Review: COMMENTED


Review of head 674c1f4836022150123bea1c437211d59c305181, as the single landing PR for #3321 and #3772.

Verdict: comment. I expect to approve the rebased head after a quick recheck. The three commits carry #3321 and #3772 with no code changes. The landing-order point from my #3772 reviews is settled on the #3321 side: its author agreed on #3321 and closed it in favour of this PR. Both sandbox runs at this head passed, and both mutants were caught. I am not approving yet for two reasons. The branch conflicts with main again, and the rebase re-resolves tests/startup_indirect_draw_indexed.cpp, the file that dispatches the provenance fixture (SHOULD 1). The #3772 author has also not answered yet.

Rebase check

  • #3772 commits. git range-diff from e2609c0e shows the two filter commits (10895c46, 674c1f48) differ only in CMakePresets.json regex context. Every source, test and doc hunk is identical.
  • #3321 commit. I compared each file's change lines in 029dfefe (its last head, a merge of main) with commit b04ac0c2 in this PR. Six of eight files match line for line: d3d12_capture.inl, both docs, the provenance .inl/.py, and the .cmake file. The other two are the conflict resolutions the PR body describes:
    • tests/startup_indirect_draw_indexed.cpp: the DrawKind::mesh condition keeps main's new modes and adds mesh-provenance. The dispatch to check_mesh_argument_provenance is the same as in 029dfefe.
    • CMakePresets.json: the pr preset gains startup_descriptor_history_check (build) and startup_mesh_argument_provenance_warp|startup_descriptor_history_(model|(filter|exhaustion|incomplete)_warp) (tests). Nothing is removed, and dev/release are unchanged.
  • Hooks against main. Between the two bases, main changed d3d12_xs_device.cpp but not the functions this PR hooks. In 674c1f48, note_view/note_copy are still called at the same view, copy, sampler and uncreated-record sites. descriptor_ranges still has its single push_back and no erase.
    • In the 73 commits on main since 70d2679d (up to ac81f34e), I found no new shadow_slot/note_view/note_copy caller and no new CopyDescriptors* call anywhere in src/.
    • I found one new CreateShaderResourceView, in native_mesh57.inl. It writes a shim-owned native heap, next to the existing call above it, not a guest descriptor.
    • That covers the merge inputs only. The rebased head still needs the recheck.
  • Safety. The diff adds no download or network call and changes no agent-config file. The new Python checks start only the built fixture executable (subprocess.run). CMakePresets.json changes only the pr preset lists above.

Findings

SHOULD

  1. Rebase onto current main. git merge-tree against ac81f34e reports conflicts in CMakePresets.json (the pr build list and test filter) and tests/startup_indirect_draw_indexed.cpp (the DrawKind::mesh condition again). GitHub shows the PR as conflicting. Both conflicts are mechanical, and the resolutions in this PR still apply: keep main's entries and modes, then add this branch's. d3d12_capture.inl and d3d12_xs_device.cpp merge cleanly.

NIT

  1. The PR body's verification is not of this head. It reports 9/9 "on the same commits rebased onto bd72fae3d". It does not give the adapter, driver, Windows build or debug-layer state that AGENTS.md asks for. R0Y00's comment and the sandbox runs below cover 674c1f48 with those fields. After the rebase, one line with the final head and environment would close this.

Before merge

  • The #3772 author has not answered on #3772 yet. The PR body says this PR will be closed if either author prefers to land their own, so that answer should come before merge.

Follow-ups (not blocking, as the body already says)

  • #3321's open points: copy events record shadow ids only, not whether the guest copy ran or which token it carried; typed buffer SRVs log no byte range; and an untracked copy source in unfiltered mode logs as new=0. Each one is a separate change to the history format, so I would track them in an issue rather than hold this PR.
  • The disabled-path benchmark against main (base against head, switch unset). With history_active() choosing the same shadow_slot calls as main, I expect the cost to be in the callers' flag reads and stack structs. It is still worth measuring once.

What the tests prove

  • startup_descriptor_history_model: the range, filter, registry, admission, budget and omission-counter logic without a GPU, including 1,024-heap discovery and randomized registry and admission runs.
  • startup_descriptor_history_filter_{warp,hardware}: with a filter set, only the selected heap windows are recorded, and invalid or disabled filters behave as documented. The GPU oracle checks the bound descriptors.
  • startup_descriptor_history_exhaustion_{warp,hardware}: the 8,192-record budget, the truncation line, and that filtered-out operations do not spend the budget.
  • startup_descriptor_history_incomplete_{warp,hardware}: per-reason omission counters at run time (opaque-copy, off, a 1,024-heap discovery overflow).
  • startup_mesh_argument_provenance_{warp,hardware}: a GPU-written Mesh argument record draws 8/8 pixels, and the history traces the bound descriptor through its create and copy events back to the source (#3321's fixture).
  • startup_indirect_mesh_* and startup_indirect_draw_indexed_*: the existing fixtures in the shared executable still pass with the mesh-provenance mode added.

Mutation results (Windows Sandbox, network off, PR tree read-only)

Each mutant passed the rebuild check (changed outputs listed) before its failures were counted.

  • M1, filter: copy plan drops the source window. At retained_registry.h:180, I replaced window(a) with an empty window.
    • Rebuild check: d3d12_xs.dll and startup_descriptor_history_check.exe changed.
    • 5 failed: model, filter_warp, filter_hardware, exhaustion_warp, exhaustion_hardware. The other 8 passed.
    • The restored tree passed 13/13.
  • P1, provenance: copy events logged as create. At d3d12_capture.inl:966, I changed the "copy" event name in note_copy's trace to "create". This reverts #3321's copy provenance trace.
    • Rebuild check: d3d12_xs.dll changed.
    • 8 failed: mesh_argument_provenance_warp and _hardware, at the assertion that the bound descriptor's second event is a copy from the source (startup_mesh_argument_provenance_check.py:52), plus filter_*, exhaustion_* and incomplete_* on both adapters, at their expected-history comparisons.
    • model and the four indirect_* tests passed, as expected: the model does not compile d3d12_capture.inl, and the indirect fixtures do not read the history.
    • The restored tree passed 13/13.

Evidence (AGENTS.md fields)

  • Commit: 674c1f4836022150123bea1c437211d59c305181, exported with git archive into Windows Sandbox, two runs (one mutant each). The network probe reported unreachable in both.
  • Commands (Debug):
    • environment: X2W_D3D12_DEBUG=1
    • configure: cmake --preset dev -DX2W_WITH_OPUS=OFF -DINTAKE_PYTHON=<venv python> -DOFFSCREEN_AGILITY_620_DIR=<Agility 1.620 dir> -DOFFSCREEN_WARP_DIR=<WARP 1.0.22 dir>
    • build: cmake --build --preset dev --target startup_descriptor_history_check startup_indirect_draw_indexed
    • test: ctest --preset dev --no-tests=error --output-on-failure -V -R '^startup_(descriptor_history_(model|(filter|exhaustion|incomplete)_(warp|hardware))|mesh_argument_provenance_(warp|hardware)|indirect_mesh_(warp|hardware)|indirect_draw_indexed_(warp|hardware))$', then the same with --repeat until-fail:5.
  • Results at the head: in each of the two runs, 13 passed, 0 failed, 0 skipped (77). The repeat-5 leg in run 1 also passed 13/13. The tests are the 13 that the regex above selects: model, filter/exhaustion/incomplete and mesh_argument_provenance on WARP and hardware, and indirect_mesh/indirect_draw_indexed on WARP and hardware.
  • Adapters, as the fixtures print them:
    • Microsoft Basic Render Driver, driver: 1.0.22.0 (app-local WARP);
    • NVIDIA GeForce RTX 4090 (sandbox vGPU), driver: 32.0.16.1088.
  • OS: Windows 11 Enterprise 10.0.26100, build 26100.
  • Toolchain: MSVC 14.44.35207, CMake 3.31.6.
  • Debug layer:
    • the in-box probe returned D3D12GetDebugInterface hr=0x00000000;
    • in each run, all 74 provenance debug info_queue= lines in the head leg read present, none read absent, and no debug ERROR or CORRUPTION line appeared.

CI

Run 46970038595 on 674c1f48: the Windows pr preset ran 299 tests with 0 failures and 5 skips (native_compute_ds_append_{warp,hardware} and three xmem_placeholder_split_* controls, none from this PR). It ran and passed 7 of this PR's tests or of the fixtures it changes:

  • startup_mesh_argument_provenance_warp;
  • startup_descriptor_history_model;
  • startup_descriptor_history_filter_warp;
  • startup_descriptor_history_exhaustion_warp;
  • startup_descriptor_history_incomplete_warp;
  • startup_indirect_mesh_warp, startup_indirect_draw_indexed_warp.

CI ran none of the _hardware tests. Those results come only from the sandbox runs above. The Linux and gfx1013 jobs passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6173886552 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3891#pullrequestreview-6173886552). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-12-03T16:25:49Z. **Review:** COMMENTED --- Review of head `674c1f4836022150123bea1c437211d59c305181`, as the single landing PR for #3321 and #3772. **Verdict: comment. I expect to approve the rebased head after a quick recheck.** The three commits carry #3321 and #3772 with no code changes. The landing-order point from my #3772 reviews is settled on the #3321 side: its author agreed on #3321 and closed it in favour of this PR. Both sandbox runs at this head passed, and both mutants were caught. I am not approving yet for two reasons. The branch conflicts with `main` again, and the rebase re-resolves `tests/startup_indirect_draw_indexed.cpp`, the file that dispatches the provenance fixture (SHOULD 1). The #3772 author has also not answered yet. ## Rebase check - **#3772 commits.** `git range-diff` from `e2609c0e` shows the two filter commits (`10895c46`, `674c1f48`) differ only in `CMakePresets.json` regex context. Every source, test and doc hunk is identical. - **#3321 commit.** I compared each file's change lines in `029dfefe` (its last head, a merge of `main`) with commit `b04ac0c2` in this PR. Six of eight files match line for line: `d3d12_capture.inl`, both docs, the provenance `.inl`/`.py`, and the `.cmake` file. The other two are the conflict resolutions the PR body describes: - `tests/startup_indirect_draw_indexed.cpp`: the `DrawKind::mesh` condition keeps `main`'s new modes and adds `mesh-provenance`. The dispatch to `check_mesh_argument_provenance` is the same as in `029dfefe`. - `CMakePresets.json`: the `pr` preset gains `startup_descriptor_history_check` (build) and `startup_mesh_argument_provenance_warp|startup_descriptor_history_(model|(filter|exhaustion|incomplete)_warp)` (tests). Nothing is removed, and `dev`/`release` are unchanged. - **Hooks against `main`.** Between the two bases, `main` changed `d3d12_xs_device.cpp` but not the functions this PR hooks. In `674c1f48`, `note_view`/`note_copy` are still called at the same view, copy, sampler and uncreated-record sites. `descriptor_ranges` still has its single `push_back` and no erase. - In the 73 commits on `main` since `70d2679d` (up to `ac81f34e`), I found no new `shadow_slot`/`note_view`/`note_copy` caller and no new `CopyDescriptors*` call anywhere in `src/`. - I found one new `CreateShaderResourceView`, in `native_mesh57.inl`. It writes a shim-owned native heap, next to the existing call above it, not a guest descriptor. - That covers the merge inputs only. The rebased head still needs the recheck. - **Safety.** The diff adds no download or network call and changes no agent-config file. The new Python checks start only the built fixture executable (`subprocess.run`). `CMakePresets.json` changes only the `pr` preset lists above. ## Findings ### SHOULD 1. **Rebase onto current `main`.** `git merge-tree` against `ac81f34e` reports conflicts in `CMakePresets.json` (the `pr` build list and test filter) and `tests/startup_indirect_draw_indexed.cpp` (the `DrawKind::mesh` condition again). GitHub shows the PR as conflicting. Both conflicts are mechanical, and the resolutions in this PR still apply: keep `main`'s entries and modes, then add this branch's. `d3d12_capture.inl` and `d3d12_xs_device.cpp` merge cleanly. ### NIT 2. **The PR body's verification is not of this head.** It reports 9/9 "on the same commits rebased onto `bd72fae3d`". It does not give the adapter, driver, Windows build or debug-layer state that AGENTS.md asks for. R0Y00's comment and the sandbox runs below cover `674c1f48` with those fields. After the rebase, one line with the final head and environment would close this. ### Before merge - The #3772 author has not answered on #3772 yet. The PR body says this PR will be closed if either author prefers to land their own, so that answer should come before merge. ### Follow-ups (not blocking, as the body already says) - #3321's open points: copy events record shadow ids only, not whether the guest copy ran or which token it carried; typed buffer SRVs log no byte range; and an untracked copy source in unfiltered mode logs as `new=0`. Each one is a separate change to the history format, so I would track them in an issue rather than hold this PR. - The disabled-path benchmark against `main` (base against head, switch unset). With `history_active()` choosing the same `shadow_slot` calls as `main`, I expect the cost to be in the callers' flag reads and stack structs. It is still worth measuring once. ## What the tests prove - `startup_descriptor_history_model`: the range, filter, registry, admission, budget and omission-counter logic without a GPU, including 1,024-heap discovery and randomized registry and admission runs. - `startup_descriptor_history_filter_{warp,hardware}`: with a filter set, only the selected heap windows are recorded, and invalid or disabled filters behave as documented. The GPU oracle checks the bound descriptors. - `startup_descriptor_history_exhaustion_{warp,hardware}`: the 8,192-record budget, the truncation line, and that filtered-out operations do not spend the budget. - `startup_descriptor_history_incomplete_{warp,hardware}`: per-reason omission counters at run time (`opaque-copy`, `off`, a 1,024-heap `discovery` overflow). - `startup_mesh_argument_provenance_{warp,hardware}`: a GPU-written Mesh argument record draws 8/8 pixels, and the history traces the bound descriptor through its `create` and `copy` events back to the source (#3321's fixture). - `startup_indirect_mesh_*` and `startup_indirect_draw_indexed_*`: the existing fixtures in the shared executable still pass with the `mesh-provenance` mode added. ## Mutation results (Windows Sandbox, network off, PR tree read-only) Each mutant passed the rebuild check (changed outputs listed) before its failures were counted. - **M1, filter: copy plan drops the source window.** At `retained_registry.h:180`, I replaced `window(a)` with an empty window. - Rebuild check: `d3d12_xs.dll` and `startup_descriptor_history_check.exe` changed. - 5 failed: `model`, `filter_warp`, `filter_hardware`, `exhaustion_warp`, `exhaustion_hardware`. The other 8 passed. - The restored tree passed 13/13. - **P1, provenance: copy events logged as `create`.** At `d3d12_capture.inl:966`, I changed the `"copy"` event name in `note_copy`'s trace to `"create"`. This reverts #3321's copy provenance trace. - Rebuild check: `d3d12_xs.dll` changed. - 8 failed: `mesh_argument_provenance_warp` and `_hardware`, at the assertion that the bound descriptor's second event is a `copy` from the source (`startup_mesh_argument_provenance_check.py:52`), plus `filter_*`, `exhaustion_*` and `incomplete_*` on both adapters, at their expected-history comparisons. - `model` and the four `indirect_*` tests passed, as expected: the model does not compile `d3d12_capture.inl`, and the indirect fixtures do not read the history. - The restored tree passed 13/13. ## Evidence (AGENTS.md fields) - **Commit:** `674c1f4836022150123bea1c437211d59c305181`, exported with `git archive` into Windows Sandbox, two runs (one mutant each). The network probe reported `unreachable` in both. - **Commands (Debug):** - environment: `X2W_D3D12_DEBUG=1` - configure: `cmake --preset dev -DX2W_WITH_OPUS=OFF -DINTAKE_PYTHON=<venv python> -DOFFSCREEN_AGILITY_620_DIR=<Agility 1.620 dir> -DOFFSCREEN_WARP_DIR=<WARP 1.0.22 dir>` - build: `cmake --build --preset dev --target startup_descriptor_history_check startup_indirect_draw_indexed` - test: `ctest --preset dev --no-tests=error --output-on-failure -V -R '^startup_(descriptor_history_(model|(filter|exhaustion|incomplete)_(warp|hardware))|mesh_argument_provenance_(warp|hardware)|indirect_mesh_(warp|hardware)|indirect_draw_indexed_(warp|hardware))$'`, then the same with `--repeat until-fail:5`. - **Results at the head:** in each of the two runs, 13 passed, 0 failed, 0 skipped (77). The repeat-5 leg in run 1 also passed 13/13. The tests are the 13 that the regex above selects: `model`, `filter`/`exhaustion`/`incomplete` and `mesh_argument_provenance` on WARP and hardware, and `indirect_mesh`/`indirect_draw_indexed` on WARP and hardware. - **Adapters, as the fixtures print them:** - Microsoft Basic Render Driver, `driver: 1.0.22.0` (app-local WARP); - NVIDIA GeForce RTX 4090 (sandbox vGPU), `driver: 32.0.16.1088`. - **OS:** Windows 11 Enterprise 10.0.26100, build 26100. - **Toolchain:** MSVC 14.44.35207, CMake 3.31.6. - **Debug layer:** - the in-box probe returned `D3D12GetDebugInterface hr=0x00000000`; - in each run, all 74 `provenance debug info_queue=` lines in the head leg read `present`, none read `absent`, and no debug ERROR or CORRUPTION line appeared. ## CI Run 46970038595 on `674c1f48`: the Windows `pr` preset ran 299 tests with 0 failures and 5 skips (`native_compute_ds_append_{warp,hardware}` and three `xmem_placeholder_split_*` controls, none from this PR). It ran and passed 7 of this PR's tests or of the fixtures it changes: - `startup_mesh_argument_provenance_warp`; - `startup_descriptor_history_model`; - `startup_descriptor_history_filter_warp`; - `startup_descriptor_history_exhaustion_warp`; - `startup_descriptor_history_incomplete_warp`; - `startup_indirect_mesh_warp`, `startup_indirect_draw_indexed_warp`. CI ran none of the `_hardware` tests. Those results come only from the sandbox runs above. The Linux and gfx1013 jobs passed.
Leyukaka commented 2026-12-03 17:17:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-03T17:17:42Z.


Thanks @Not-Saii for the detailed review and the two mutants.

SHOULD 1 (rebase). Rebased onto 8cb022dbc and force-pushed; new head 707291193ac9d3508232a83832a8924fc92ee86d. The three commits keep their original authors, dates, messages and trailers. git range-diff against 674c1f48 differs only in the conflict context:

  • CMakePresets.json: kept main's pr build targets and test filter, then re-added this branch's startup_descriptor_history_check target and startup_mesh_argument_provenance_warp|startup_descriptor_history_(model|(filter|exhaustion|incomplete)_warp).
  • tests/startup_indirect_draw_indexed.cpp: the DrawKind::mesh condition keeps main's derived_mesh and adds mesh-provenance. The dispatch to check_mesh_argument_provenance is unchanged.
  • docs/experiments.md: the index entry added by the second commit and removed by the third now sits after main's new entries; the net change is still none.

d3d12_capture.inl and d3d12_xs_device.cpp merged cleanly. The 3 commits on main since ac81f34e add no note_view/note_copy/shadow_slot caller and no CopyDescriptors* or view-creation call in src/.

NIT 2 (verification of this head). Run at 707291193ac9d3508232a83832a8924fc92ee86d, on Windows with MSVC, on WARP and on a hardware adapter. The same 13 tests as in your review passed (13/13, 0 failed):

  • startup_descriptor_history_model
  • startup_descriptor_history_{filter,exhaustion,incomplete}_{warp,hardware}
  • startup_mesh_argument_provenance_{warp,hardware}
  • startup_indirect_mesh_{warp,hardware}
  • startup_indirect_draw_indexed_{warp,hardware}

The PR body's older 9/9 line refers to the previous base; this run replaces it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7386278787 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3891#issuecomment-7386278787). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-12-03T17:17:42Z. --- Thanks @Not-Saii for the detailed review and the two mutants. **SHOULD 1 (rebase).** Rebased onto `8cb022dbc` and force-pushed; new head `707291193ac9d3508232a83832a8924fc92ee86d`. The three commits keep their original authors, dates, messages and trailers. `git range-diff` against `674c1f48` differs only in the conflict context: - `CMakePresets.json`: kept `main`'s `pr` build targets and test filter, then re-added this branch's `startup_descriptor_history_check` target and `startup_mesh_argument_provenance_warp|startup_descriptor_history_(model|(filter|exhaustion|incomplete)_warp)`. - `tests/startup_indirect_draw_indexed.cpp`: the `DrawKind::mesh` condition keeps `main`'s `derived_mesh` and adds `mesh-provenance`. The dispatch to `check_mesh_argument_provenance` is unchanged. - `docs/experiments.md`: the index entry added by the second commit and removed by the third now sits after `main`'s new entries; the net change is still none. `d3d12_capture.inl` and `d3d12_xs_device.cpp` merged cleanly. The 3 commits on `main` since `ac81f34e` add no `note_view`/`note_copy`/`shadow_slot` caller and no `CopyDescriptors*` or view-creation call in `src/`. **NIT 2 (verification of this head).** Run at `707291193ac9d3508232a83832a8924fc92ee86d`, on Windows with MSVC, on WARP and on a hardware adapter. The same 13 tests as in your review passed (13/13, 0 failed): - `startup_descriptor_history_model` - `startup_descriptor_history_{filter,exhaustion,incomplete}_{warp,hardware}` - `startup_mesh_argument_provenance_{warp,hardware}` - `startup_indirect_mesh_{warp,hardware}` - `startup_indirect_draw_indexed_{warp,hardware}` The PR body's older 9/9 line refers to the previous base; this run replaces it.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3891:upstream-pr/3891'
git switch 'upstream-pr/3891'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3891'
git switch 'upstream-pr/3891'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3891'
git switch 'upstream-pr/3891'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3891'
git switch 'main'
git merge --squash 'upstream-pr/3891'
git switch 'main'
git merge --ff-only 'upstream-pr/3891'
git switch 'main'
git merge 'upstream-pr/3891'
git push origin 'main'
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!3891
No description provided.