startup: wire PerReasonRefusalCensus into ExecuteIndirect other refusals #2403

Merged
stan495 merged 2 commits from upstream-pr/2411 into main 2026-11-25 18:38:29 +00:00
stan495 commented 2026-11-25 15:42:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T15:42:28Z.


Summary

Wire a bounded PerReasonRefusalCensus instance (indirect-other) into list_execute_indirect so ExecuteIndirect pre-check refusals counted under other are attributed per (pipeline key, reason_code) instead of becoming silent after the global 16-call refusal log cap is spent.

  • src/startup_stubs/d3d12_xs_device.cpp:
    • Add indirect_other_refusal_census{indirect-other} alongside indirect_draw_refusal_census.
    • Assign stable snake_case refusal codes (indirect_other_refusal_code) to every indirect_other refusal site in list_execute_indirect, splitting the combined render-target/state check into
      o_render_target, multiple_render_targets, depth_target_bound, missing_viewport_or_scissor, and arget_format_mismatch without altering control flow or refusal conditions.
    • Keep logging the first occurrence of each of the first 8 distinct (key, reason) pairs even after the 16-call global refusal cap is spent, emit periodic deltas in queue_present, and append x2w-d3d12 indirect-other refusals: to x2w_d3d12_census_report only when otal() > 0 (leaving zero-refusal runs unchanged).
  • src/startup_stubs/d3d12_draw.inl:
    • Add side-effect-free known_pipeline_key(Wrapper*) for refusal attribution (mesh86_key, compute_trace_key, already-known ranslation_by_pipeline() entry, or slot-86 stream_translation->key, otherwise
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6608230955 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2411). Originally posted by [stan495](https://github.com/stan495) on 2026-11-25T15:42:28Z. --- ## Summary Wire a bounded PerReasonRefusalCensus instance (indirect-other) into list_execute_indirect so ExecuteIndirect pre-check refusals counted under other are attributed per (pipeline key, reason_code) instead of becoming silent after the global 16-call refusal log cap is spent. - **src/startup_stubs/d3d12_xs_device.cpp**: - Add indirect_other_refusal_census{indirect-other} alongside indirect_draw_refusal_census. - Assign stable snake_case refusal codes (indirect_other_refusal_code) to every indirect_other refusal site in list_execute_indirect, splitting the combined render-target/state check into o_render_target, multiple_render_targets, depth_target_bound, missing_viewport_or_scissor, and arget_format_mismatch without altering control flow or refusal conditions. - Keep logging the first occurrence of each of the first 8 distinct (key, reason) pairs even after the 16-call global refusal cap is spent, emit periodic deltas in queue_present, and append x2w-d3d12 indirect-other refusals: to x2w_d3d12_census_report only when otal() > 0 (leaving zero-refusal runs unchanged). - **src/startup_stubs/d3d12_draw.inl**: - Add side-effect-free known_pipeline_key(Wrapper*) for refusal attribution (mesh86_key, compute_trace_key, already-known ranslation_by_pipeline() entry, or slot-86 stream_translation->key, otherwise
KelboLive commented 2026-11-25 16:05:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-25T16:04:33Z.


APPROVED: Wiring PerReasonRefusalCensus into ExecuteIndirect refusals.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167570751 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2411#issuecomment-7167570751). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-25T16:04:33Z. --- APPROVED: Wiring PerReasonRefusalCensus into ExecuteIndirect refusals.
tedin7 commented 2026-11-25 17:01:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:23:04Z.

Review: COMMENTED


Review of head f23428ff (comment only).

Checked:

  • git diff --stat origin/main...HEAD: 5 files, additive, same shape as merged #2333 (translated draws). No duplicate open or merged PR for the "other refusals" slice (gh pr list --state all --search "PerReasonRefusalCensus ExecuteIndirect").
  • known_pipeline_key (d3d12_draw.inl) is a side-effect-free lookup (no translation request file written), takes draw_lock shared like the sibling lookups, and returns 0 for unknown pipelines.
  • refusal_pipeline is set at d3d12_xs_device.cpp:2670, so refusals before that point report key 0 with a reason code, which is expected.
  • Reason codes cover every refusal path I could find in list_execute_indirect; unlisted ones fall to unknown.
  • Test: indirect-other-refusal-census checks the summary line, the per-(key, reason) detail rows and the log lines on WARP, plus a negative control (..._control_warp) with a PASS_REGULAR_EXPRESSION on the real totals. Both are registered in CMake next to the sibling census tests. Docs updated.

No blocking findings. Win2025 WARP dev+release will be run next.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6061086234 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2411#pullrequestreview-6061086234). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:23:04Z. **Review:** COMMENTED --- Review of head f23428ff (comment only). Checked: - `git diff --stat origin/main...HEAD`: 5 files, additive, same shape as merged #2333 (translated draws). No duplicate open or merged PR for the "other refusals" slice (`gh pr list --state all --search "PerReasonRefusalCensus ExecuteIndirect"`). - `known_pipeline_key` (d3d12_draw.inl) is a side-effect-free lookup (no translation request file written), takes `draw_lock` shared like the sibling lookups, and returns 0 for unknown pipelines. - `refusal_pipeline` is set at d3d12_xs_device.cpp:2670, so refusals before that point report key 0 with a reason code, which is expected. - Reason codes cover every refusal path I could find in `list_execute_indirect`; unlisted ones fall to `unknown`. - Test: `indirect-other-refusal-census` checks the summary line, the per-(key, reason) detail rows and the log lines on WARP, plus a negative control (`..._control_warp`) with a PASS_REGULAR_EXPRESSION on the real totals. Both are registered in CMake next to the sibling census tests. Docs updated. No blocking findings. Win2025 WARP dev+release will be run next. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 17:01:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:25:19Z.


Win2025 WARP receipt for head f23428ff after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit f23428ffc8670785af138b2bf1d37104fc97c94a:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_indirect_draw_indexed -- -j 2): 3.36s (configure 0.00s)
    • Test (ctest --preset dev -R 'startup_indirect.*_warp' --parallel 6 --no-tests=error --output-on-failure): 34/34 passed (1.76s: startup_indirect_copy_provenance_off_warp 0.22s, startup_indirect_rectlist_warp 0.37s, startup_indirect_copy_provenance_warp 0.20s, startup_indirect_requests_warp 0.46s, startup_indirect_translated_draw_warp 0.16s, startup_indirect_translated_indexed_rect_warp 0.18s, startup_indirect_translated_indexed_warp 0.17s, startup_indirect_mesh_lease_warp_ordered_control 0.66s, startup_indirect_mesh_lease_warp_skip-wait 0.65s, startup_indirect_mesh_cache_warp 0.69s, startup_indirect_mesh_xmem_arguments_warp 0.18s, startup_indirect_dispatch_warp 0.08s, startup_indirect_root_constants_warp 0.09s, startup_indirect_translated_indexed_alias_warp 0.13s, startup_indirect_translated_indexed_upload_warp 0.13s, startup_indirect_mesh_warp 0.08s, startup_indirect_mesh_request_warp 0.07s, startup_indirect_draw_warp 0.10s, startup_indirect_draw_indexed_warp 0.10s, startup_indirect_counts_control_warp 0.10s, startup_indirect_translated_indexed_alias_off_warp 0.09s, startup_indirect_mesh_create_result_warp 0.04s, startup_indirect_mesh_xmem_arguments_skip_wait_warp 0.14s, startup_indirect_mesh_amplified_warp 0.08s, startup_indirect_mesh_console_warp 0.08s, startup_indirect_count_warp 0.09s, startup_indirect_translated_refusal_census_warp 0.14s, startup_indirect_other_refusal_census_warp 0.12s, startup_indirect_other_refusal_census_control_warp 0.12s, startup_indirect_translated_refusal_census_control_warp 0.14s, startup_indirect_mesh_lease_warp_dual-skip-srv 0.60s, startup_indirect_mesh_lease_warp_dual-skip-argument 0.57s, startup_indirect_mesh_lease_warp_dual 0.71s, startup_indirect_mesh_lease_warp_dual-init-only 0.64s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_indirect_draw_indexed -- -j 2): 1.77s (configure 0.00s)
    • Test (ctest --preset release -R 'startup_indirect.*_warp' --parallel 6 --no-tests=error --output-on-failure): 34/34 passed (1.61s: startup_indirect_translated_draw_warp 0.14s, startup_indirect_copy_provenance_warp 0.19s, startup_indirect_rectlist_warp 0.27s, startup_indirect_translated_indexed_rect_warp 0.19s, startup_indirect_copy_provenance_off_warp 0.18s, startup_indirect_mesh_request_warp 0.07s, startup_indirect_translated_indexed_warp 0.17s, startup_indirect_mesh_console_warp 0.07s, startup_indirect_mesh_warp 0.07s, startup_indirect_draw_warp 0.09s, startup_indirect_counts_control_warp 0.09s, startup_indirect_mesh_amplified_warp 0.07s, startup_indirect_draw_indexed_warp 0.08s, startup_indirect_mesh_lease_warp_skip-wait 0.61s, startup_indirect_mesh_cache_warp 0.64s, startup_indirect_mesh_lease_warp_ordered_control 0.64s, startup_indirect_translated_indexed_alias_warp 0.12s, startup_indirect_translated_indexed_upload_warp 0.13s, startup_indirect_mesh_create_result_warp 0.04s, startup_indirect_translated_indexed_alias_off_warp 0.07s, startup_indirect_dispatch_warp 0.11s, startup_indirect_mesh_xmem_arguments_skip_wait_warp 0.11s, startup_indirect_mesh_xmem_arguments_warp 0.18s, startup_indirect_count_warp 0.09s, startup_indirect_root_constants_warp 0.11s, startup_indirect_other_refusal_census_warp 0.10s, startup_indirect_translated_refusal_census_warp 0.12s, startup_indirect_translated_refusal_census_control_warp 0.14s, startup_indirect_other_refusal_census_control_warp 0.11s, startup_indirect_requests_warp 0.44s, startup_indirect_mesh_lease_warp_dual-skip-srv 0.59s, startup_indirect_mesh_lease_warp_dual-skip-argument 0.58s, startup_indirect_mesh_lease_warp_dual 0.69s, startup_indirect_mesh_lease_warp_dual-init-only 0.66s)
  • sccache: 6/6 hits; wall 13.8s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167954639 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2411#issuecomment-7167954639). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:25:19Z. --- Win2025 WARP receipt for head f23428ff after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `f23428ffc8670785af138b2bf1d37104fc97c94a`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_indirect_draw_indexed -- -j 2`): `3.36s` (configure `0.00s`) - Test (`ctest --preset dev -R 'startup_indirect.*_warp' --parallel 6 --no-tests=error --output-on-failure`): **34/34 passed** (`1.76s`: `startup_indirect_copy_provenance_off_warp` `0.22s`, `startup_indirect_rectlist_warp` `0.37s`, `startup_indirect_copy_provenance_warp` `0.20s`, `startup_indirect_requests_warp` `0.46s`, `startup_indirect_translated_draw_warp` `0.16s`, `startup_indirect_translated_indexed_rect_warp` `0.18s`, `startup_indirect_translated_indexed_warp` `0.17s`, `startup_indirect_mesh_lease_warp_ordered_control` `0.66s`, `startup_indirect_mesh_lease_warp_skip-wait` `0.65s`, `startup_indirect_mesh_cache_warp` `0.69s`, `startup_indirect_mesh_xmem_arguments_warp` `0.18s`, `startup_indirect_dispatch_warp` `0.08s`, `startup_indirect_root_constants_warp` `0.09s`, `startup_indirect_translated_indexed_alias_warp` `0.13s`, `startup_indirect_translated_indexed_upload_warp` `0.13s`, `startup_indirect_mesh_warp` `0.08s`, `startup_indirect_mesh_request_warp` `0.07s`, `startup_indirect_draw_warp` `0.10s`, `startup_indirect_draw_indexed_warp` `0.10s`, `startup_indirect_counts_control_warp` `0.10s`, `startup_indirect_translated_indexed_alias_off_warp` `0.09s`, `startup_indirect_mesh_create_result_warp` `0.04s`, `startup_indirect_mesh_xmem_arguments_skip_wait_warp` `0.14s`, `startup_indirect_mesh_amplified_warp` `0.08s`, `startup_indirect_mesh_console_warp` `0.08s`, `startup_indirect_count_warp` `0.09s`, `startup_indirect_translated_refusal_census_warp` `0.14s`, `startup_indirect_other_refusal_census_warp` `0.12s`, `startup_indirect_other_refusal_census_control_warp` `0.12s`, `startup_indirect_translated_refusal_census_control_warp` `0.14s`, `startup_indirect_mesh_lease_warp_dual-skip-srv` `0.60s`, `startup_indirect_mesh_lease_warp_dual-skip-argument` `0.57s`, `startup_indirect_mesh_lease_warp_dual` `0.71s`, `startup_indirect_mesh_lease_warp_dual-init-only` `0.64s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_indirect_draw_indexed -- -j 2`): `1.77s` (configure `0.00s`) - Test (`ctest --preset release -R 'startup_indirect.*_warp' --parallel 6 --no-tests=error --output-on-failure`): **34/34 passed** (`1.61s`: `startup_indirect_translated_draw_warp` `0.14s`, `startup_indirect_copy_provenance_warp` `0.19s`, `startup_indirect_rectlist_warp` `0.27s`, `startup_indirect_translated_indexed_rect_warp` `0.19s`, `startup_indirect_copy_provenance_off_warp` `0.18s`, `startup_indirect_mesh_request_warp` `0.07s`, `startup_indirect_translated_indexed_warp` `0.17s`, `startup_indirect_mesh_console_warp` `0.07s`, `startup_indirect_mesh_warp` `0.07s`, `startup_indirect_draw_warp` `0.09s`, `startup_indirect_counts_control_warp` `0.09s`, `startup_indirect_mesh_amplified_warp` `0.07s`, `startup_indirect_draw_indexed_warp` `0.08s`, `startup_indirect_mesh_lease_warp_skip-wait` `0.61s`, `startup_indirect_mesh_cache_warp` `0.64s`, `startup_indirect_mesh_lease_warp_ordered_control` `0.64s`, `startup_indirect_translated_indexed_alias_warp` `0.12s`, `startup_indirect_translated_indexed_upload_warp` `0.13s`, `startup_indirect_mesh_create_result_warp` `0.04s`, `startup_indirect_translated_indexed_alias_off_warp` `0.07s`, `startup_indirect_dispatch_warp` `0.11s`, `startup_indirect_mesh_xmem_arguments_skip_wait_warp` `0.11s`, `startup_indirect_mesh_xmem_arguments_warp` `0.18s`, `startup_indirect_count_warp` `0.09s`, `startup_indirect_root_constants_warp` `0.11s`, `startup_indirect_other_refusal_census_warp` `0.10s`, `startup_indirect_translated_refusal_census_warp` `0.12s`, `startup_indirect_translated_refusal_census_control_warp` `0.14s`, `startup_indirect_other_refusal_census_control_warp` `0.11s`, `startup_indirect_requests_warp` `0.44s`, `startup_indirect_mesh_lease_warp_dual-skip-srv` `0.59s`, `startup_indirect_mesh_lease_warp_dual-skip-argument` `0.58s`, `startup_indirect_mesh_lease_warp_dual` `0.69s`, `startup_indirect_mesh_lease_warp_dual-init-only` `0.66s`) - `sccache`: 6/6 hits; wall `13.8s` AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 19:03:37 +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!2403
No description provided.