Depth plane before the class draws; steadier heap pass; less per-submission work; 64-lane-only refusals #4

Manually merged
github merged 6 commits from gh-pr/4/head into gh-pr/4/base 2026-11-26 05:57:08 +00:00
Owner

@⁠TaynanGT on GitHub · 2026-11-25 08:47 UTC · original
TaynanGT:historico/victory-windows-4-head → historico/victory-windows-4-base · +368 −70 · 8 files · 6 commits · merged 2026-11-25 08:47 UTC

Summary

Rendering

  • Depth plane drawn before a draw tests it. The title's tiled lighting writes each pixel's material class into the twin of a depth plane, then draws each class with the depth test "equal". The pass that draws the twin into the plane ran only when the list closed, after those draws. So every frame they tested the classes of the frame before: in a release run, the frame line's "times used before the pass" grew by one a frame (962 to 2219 over 159 s). The depth target's bind for a draw now records the pass first, when the plane is behind (a copy due, or an earlier use that saw it late), and the draw's state is set again after it (State::replay). Copies, clears and shader reads keep the late path. The visible effect (pixels lit by the wrong class along material edges and in motion) is expected, not yet confirmed in game.
  • Translations that still need 64-lane waves on a 32-lane host are refused at translation with the reason, instead of handed over with WaveSize(64) for CreateComputePipelineState to refuse with E_INVALIDARG and no reason on every run. That hit 3 to 7 of the prologue's compute shaders on an RTX 4090. They now get the constant-edge retry. Their dispatches are dropped as before; hosts with 64-lane waves are unaffected.

Frame time

  • Heap buffer pass. Every 16th pass revisited all of a heap's buffer slots (some 70,000). In a release run, the heap pass alternated between 11 ms and 1.9 ms frame averages per second: about 73 ms on one frame in 16, on the thread recording the title's list. Each pass now revisits the next sixteenth in turn, with the slots written since. The mean and the coverage are the same (each slot within about 16 passes), without the spike.
  • Fixed per-submission work.
    • CardNotes::take built and allocated an empty Arc for every card copy with nothing noted, on every send (~600 copies, ~30 sends a frame, ~20 copies with notes). It now returns a shared empty one, with the same sends and notes.
    • Batch::flush gathered every pending refresh's range, and ask_ahead sorted them, before finding that the submission's one asking stands. The flush now skips both while it stands; the journal is left as it was.
    • Saving: not measured. Estimate: under ~1 ms a frame.
  • Partly streamed textures (opt-in). The heap pass looks again at every texture uploaded in part, asking the kernel about each 64 KiB of it, although the runtime's notices already make a slot due when memory is mapped, unmapped or written under it. That cost 4.5 ms a frame on average in a release run (peaks of 13-16 ms).
    • The frame line now counts looks that found more of a texture mapped with no notice between ("arrived unannounced"), which are the cases the looks are for.
    • VICTORY_TEXTURE_PARK_FRAMES=<n> (off by default) lets a texture uploaded in part, and found no further along, wait up to n frames before the next look. With it on, dropped notices make the slots waiting on looks due at once.
    • To be tried only where the new counter stays about 0 through a long run with streaming.

Minor (left open in #3)

  • in_place_let_go now starts its walk as far below the remapped range as the longest loose window has been, instead of at the bottom of the map.
  • a_cancelled_pending_call_drops_its_late_result waits for the work thread to end instead of sleeping 100 ms.

Verification

  • cargo test -p victory-shader --lib passes on Linux (211). The new a_translation_that_still_needs_64_lanes_is_refused_on_a_32_lane_host fails with the old pass-through and passes with the change.
  • New and changed Windows tests run in this PR's CI:
    • a_depth_planes_twin_is_drawn_before_a_draw_tests_the_plane: twin written and "equal" class draws in one list. Each class must cover exactly its texels, and the pass must be recorded once.
    • directly_indexed_buffer_ranges_follow_the_heap_lifetime, adjusted: every slot within 16 passes, the kept entries untouched until revisited.
    • dropped_notices_make_the_slots_waiting_on_looks_due.
    • the xasync test.
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, with and without --all-features, passes (cross-checked from Linux).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64

Origem TaynanGT/victory-windows#4, aberto por TaynanGT em 11/25/2026 08:09:23.
Integração original em 11/25/2026 08:29:54, commit 0f26d9d.

**@⁠TaynanGT** on GitHub · 2026-11-25 08:47 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/4) `TaynanGT:historico/victory-windows-4-head` → `historico/victory-windows-4-base` · +368 −70 · 8 files · 6 commits · merged 2026-11-25 08:47 UTC ## Summary ### Rendering - **Depth plane drawn before a draw tests it.** The title's tiled lighting writes each pixel's material class into the twin of a depth plane, then draws each class with the depth test "equal". The pass that draws the twin into the plane ran only when the list closed, after those draws. So every frame they tested the classes of the frame before: in a release run, the frame line's "times used before the pass" grew by one a frame (962 to 2219 over 159 s). The depth target's bind for a draw now records the pass first, when the plane is behind (a copy due, or an earlier use that saw it late), and the draw's state is set again after it (`State::replay`). Copies, clears and shader reads keep the late path. The visible effect (pixels lit by the wrong class along material edges and in motion) is expected, not yet confirmed in game. - **Translations that still need 64-lane waves on a 32-lane host** are refused at translation with the reason, instead of handed over with `WaveSize(64)` for `CreateComputePipelineState` to refuse with E_INVALIDARG and no reason on every run. That hit 3 to 7 of the prologue's compute shaders on an RTX 4090. They now get the constant-edge retry. Their dispatches are dropped as before; hosts with 64-lane waves are unaffected. ### Frame time - **Heap buffer pass.** Every 16th pass revisited all of a heap's buffer slots (some 70,000). In a release run, the heap pass alternated between 11 ms and 1.9 ms frame averages per second: about 73 ms on one frame in 16, on the thread recording the title's list. Each pass now revisits the next sixteenth in turn, with the slots written since. The mean and the coverage are the same (each slot within about 16 passes), without the spike. - **Fixed per-submission work.** - `CardNotes::take` built and allocated an empty `Arc` for every card copy with nothing noted, on every send (~600 copies, ~30 sends a frame, ~20 copies with notes). It now returns a shared empty one, with the same sends and notes. - `Batch::flush` gathered every pending refresh's range, and `ask_ahead` sorted them, before finding that the submission's one asking stands. The flush now skips both while it stands; the journal is left as it was. - Saving: not measured. Estimate: under ~1 ms a frame. - **Partly streamed textures (opt-in).** The heap pass looks again at every texture uploaded in part, asking the kernel about each 64 KiB of it, although the runtime's notices already make a slot due when memory is mapped, unmapped or written under it. That cost 4.5 ms a frame on average in a release run (peaks of 13-16 ms). - The frame line now counts looks that found more of a texture mapped with no notice between ("arrived unannounced"), which are the cases the looks are for. - `VICTORY_TEXTURE_PARK_FRAMES=<n>` (off by default) lets a texture uploaded in part, and found no further along, wait up to n frames before the next look. With it on, dropped notices make the slots waiting on looks due at once. - To be tried only where the new counter stays about 0 through a long run with streaming. ### Minor (left open in #3) - `in_place_let_go` now starts its walk as far below the remapped range as the longest loose window has been, instead of at the bottom of the map. - `a_cancelled_pending_call_drops_its_late_result` waits for the work thread to end instead of sleeping 100 ms. ## Verification - `cargo test -p victory-shader --lib` passes on Linux (211). The new `a_translation_that_still_needs_64_lanes_is_refused_on_a_32_lane_host` fails with the old pass-through and passes with the change. - New and changed Windows tests run in this PR's CI: - `a_depth_planes_twin_is_drawn_before_a_draw_tests_the_plane`: twin written and "equal" class draws in one list. Each class must cover exactly its texels, and the pass must be recorded once. - `directly_indexed_buffer_ranges_follow_the_heap_lifetime`, adjusted: every slot within 16 passes, the kept entries untouched until revisited. - `dropped_notices_make_the_slots_waiting_on_looks_due`. - the `xasync` test. - `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings`, with and without `--all-features`, passes (cross-checked from Linux). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64 <!-- migracao:victory-windows#4 --> Origem [TaynanGT/victory-windows#4](https://github.com/TaynanGT/victory-windows/pull/4), aberto por [TaynanGT](https://github.com/TaynanGT) em 11/25/2026 08:09:23. Integração original em 11/25/2026 08:29:54, commit [0f26d9d](https://github.com/TaynanGT/VIctory/commit/0f26d9d851f6a8fe7b1e08e1b457f94a1c30dcf7).
- in_place_let_go walked every loose window below the remapped range's
  end, under the lock the asks take, on every remap. It now starts as far
  below the range as the longest window the map has held, which no
  window reaching the range can exceed.
- a_cancelled_pending_call_drops_its_late_result waited 100 ms for the
  work thread to finish; on a loaded machine it could pass before the
  thread had completed anything. The thread now notes its block when it
  ends (in tests), and the test waits for that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
A console wave64 program that no form carries in 32 lanes was handed
over with WaveSize(64), and on an RTX 4090 (waves of 32)
CreateComputePipelineState refused it with E_INVALIDARG and no reason,
on every run, for 3 to 7 of the prologue's compute shaders. It is now
refused at translation with the reason ("a console wave64 program that
still needs 64-lane waves"), and gets the constant-edge retry that only
refused programs had. Its dispatches are dropped as before. Hosts with
64-lane waves are unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
The title's tiled lighting writes each pixel's material class into the
twin of a depth plane, then draws each class with the depth test equal.
The pass that draws the twin into the plane ran only when the list
closed, after those draws, so every frame they tested the classes of the
frame before: the frame line's "times used before the pass" grew by one
a frame (962 to 2219 over 159 s in a release run).

The depth target's bind for a draw now records the pass first, when the
plane is behind (a copy due, or a use that saw it late), and the draw's
state is set again after it (State::replay). Copies, clears and shader
reads keep the late path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
- CardNotes::take built and allocated an empty Arc for every card copy
  with nothing noted, on every send (~600 copies, ~30 sends a frame, ~20
  copies with notes), only for card_dirty to drop it. It returns a
  shared empty one now, with the same sends and notes.
- Batch::flush gathered every pending refresh's range and ask_ahead
  sorted them before finding that the submission's one asking stands and
  returning. The flush skips both while it stands (watch::asking_stands);
  the journal is left as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
Every 16th pass of BufferViews::begin_pass revisited all of a heap's
buffer slots (some 70,000): a release run's heap pass alternated between
11 ms and 1.9 ms frame averages a second, about 73 ms of one frame in
16 on the thread recording the title's list. Each pass now revisits the
next sixteenth in turn with the slots written since: the same mean and
the same coverage (each slot within about 16 passes), without the spike.
The first pass of a heap still takes all.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
The heap pass looks again at every texture uploaded in part, asking the
kernel about each 64 KiB of it, although the runtime's notices already
make a slot due when memory is mapped, unmapped or written under it:
4.5 ms a frame on average in a release run (241 slots looked at, peaks
of 13-16 ms), with "looks that found no more mapped" growing by ~153 a
frame.

- The frame line now counts looks that found more of a texture mapped
  with no notice between ("arrived unannounced"), the cases the looks
  are for.
- VICTORY_TEXTURE_PARK_FRAMES=<n> (off by default) lets a texture
  uploaded in part and found no further along wait up to n frames before
  the next look. With it on, dropped notices make the slots waiting on
  looks due at once. To be tried where the new counter stays about 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:57:05 +00:00
github manually merged commit d324421ed6 into gh-pr/4/base 2026-11-26 05:57:08 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-25 08:47 UTC · original

Comentário original de chatgpt-codex-connector[bot] em 11/25/2026 08:30:03. Ver original.

<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} -->
<!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","mergeGateEnabled":false,"pullRequestNumber":4,"repository":"TaynanGT/victory-windows","status":"completed"} -->
<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-25T08:30:54.076732Z">2026-11-25T08:30:54.076732Z</relative-time> | `d324421` | Draft marked ready |
| 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-25T08:32:29.683159Z">2026-11-25T08:32:29.683159Z</relative-time> | `d324421` | 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>
**@⁠TaynanGT** on GitHub · 2026-11-25 08:47 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/4#issuecomment-7157478071) Comentário original de `chatgpt-codex-connector[bot]` em 11/25/2026 08:30:03. [Ver original](https://github.com/TaynanGT/victory-windows/pull/4#issuecomment-7157100211). ``` <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","mergeGateEnabled":false,"pullRequestNumber":4,"repository":"TaynanGT/victory-windows","status":"completed"} --> <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-25T08:30:54.076732Z">2026-11-25T08:30:54.076732Z</relative-time> | `d324421` | Draft marked ready | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-25T08:32:29.683159Z">2026-11-25T08:32:29.683159Z</relative-time> | `d324421` | 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> ``` <!-- migracao:comentario-7157100211 -->
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 08:47 UTC · original

To use Codex here, create an environment for this repo.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 08:47 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/4#issuecomment-7157481333) To use Codex here, [create an environment for this repo](https://chatgpt.com/codex/cloud/settings/environments).
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 08:47 UTC · original · edited 2026-11-25 08:49 UTC

Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-25T08:48:03.713522Z
We couldn’t complete this review. Comment @codex review to try again.
d324421 PR opened
🔒 Security Review ✅ Completed 2026-11-25T08:49:02.979428Z d324421 PR opened
ℹ️ 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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 08:47 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/4#issuecomment-7157478780) · edited 2026-11-25 08:49 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"d324421ed6ae960fee2ef8022a5f8daf98a7aeaf","mergeGateEnabled":false,"pullRequestNumber":4,"repository":"TaynanGT/Vice-Tay","status":"completed"} --> <details> <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ❌ **Failed** <relative-time datetime="2026-11-25T08:48:03.713522Z">2026-11-25T08:48:03.713522Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `d324421` | PR opened | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-25T08:49:02.979428Z">2026-11-25T08:49:02.979428Z</relative-time> | `d324421` | PR opened | <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>
This discussion has been locked. Commenting is limited to contributors.
No description provided.