Reuse heap sync rounds on current main #343

Merged
TaynanGT merged 3 commits from upstream-pr/343 into main 2026-11-27 18:53:58 +00:00
TaynanGT commented 2026-11-27 18:34:11 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T18:34:11Z.


Bring Petr Seifert’s heap-sync rounds from #323 onto current main. When queued submissions can use the same completed round, let them share it. Keep the #311 check that closes host lists before submission preparation.

The existing round-coalescing unit test passed in an isolated Windows run. The combined diff keeps the four source files from #323 and resolves the single conflict at Host::submit.

Original change by PetrSeifert.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5531436623 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/343). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T18:34:11Z. --- Bring Petr Seifert’s heap-sync rounds from #323 onto current main. When queued submissions can use the same completed round, let them share it. Keep the #311 check that closes host lists before submission preparation. The existing round-coalescing unit test passed in an isolated Windows run. The combined diff keeps the four source files from #323 and resolves the single conflict at `Host::submit`. Original change by [PetrSeifert](https://github.com/TaynanGT/Vice-Tay/pull/323).
chatgpt-codex-connector[bot] commented 2026-11-27 18:34:25 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T18:34:25Z.


Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T18:47:11.482142Z 398b72c New commits
🔒 Security Review ✅ Completed 2026-11-27T18:48:38.622791Z 398b72c New commits
ℹ️ 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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7225630130 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/343#issuecomment-7225630130). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T18:34:25Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"398b72c455a08ea0482f94e9ddff67d208570608","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":"398b72c455a08ea0482f94e9ddff67d208570608","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"398b72c455a08ea0482f94e9ddff67d208570608","mergeGateEnabled":false,"pullRequestNumber":343,"repository":"TaynanGT/Vice-Tay","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-27T18:47:11.482142Z">2026-11-27T18:47:11.482142Z</relative-time> | `398b72c` | New commits | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-27T18:48:38.622791Z">2026-11-27T18:48:38.622791Z</relative-time> | `398b72c` | New commits | <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>
chatgpt-codex-connector[bot] commented 2026-11-27 18:36:50 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T18:36:50Z.

Code review location: crates/victory-gpu/src/host.rs; line 7293

@@ -7237,10 +7284,11 @@ impl Host {
         // Descriptors the title copied into placed heaps directly, before
         // command lists that index those slots are submitted.
         // Renderer port #7 (from renderer patch #4): the round asked for when
-        // the title submitted it, if that is known (`crate::port_journal`).
+        // the title submitted it, if that is known (`crate::port_journal`),
+        // otherwise the enqueue-time `heap_sync` stamp (`SyncRounds`).
         let heaps_on = crate::port_journal::on();
         let heaps_synced = match crate::port_journal::needed() {
-            0 => crate::descriptor::begin_sync_heaps(),
+            0 => crate::descriptor::begin_sync_heaps_for(heap_sync),
             mark => crate::descriptor::begin_sync_heaps_after(mark),
         };

P1 Badge Recheck the heap-sync floor after deferred descriptor writes

With asynchronous heap sync enabled and the default VICTORY_PORT_JOURNAL setting, a queued submission can now reuse a round completed before preparation and receive SyncedHeaps(None) here. However, run_deferred subsequently executes Step::Copy, free Step::Placed, and Step::RawCopy operations that can write descriptor-heap memory. Their prep_wrote() calls raise the floor, but nothing rechecks it before drop(heaps_synced) at line 7484; that drop simply returns for None. Consequently, the submission can execute with stale host descriptors even though its preparation updated the title-side records. Revalidate the required round after deferred writes and any preparation-time landings, before sending the command lists.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review-comment:4722697041 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/343#discussion_r4722697041). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T18:36:50Z. **Code review location:** `crates/victory-gpu/src/host.rs`; line 7293 ~~~~diff @@ -7237,10 +7284,11 @@ impl Host { // Descriptors the title copied into placed heaps directly, before // command lists that index those slots are submitted. // Renderer port #7 (from renderer patch #4): the round asked for when - // the title submitted it, if that is known (`crate::port_journal`). + // the title submitted it, if that is known (`crate::port_journal`), + // otherwise the enqueue-time `heap_sync` stamp (`SyncRounds`). let heaps_on = crate::port_journal::on(); let heaps_synced = match crate::port_journal::needed() { - 0 => crate::descriptor::begin_sync_heaps(), + 0 => crate::descriptor::begin_sync_heaps_for(heap_sync), mark => crate::descriptor::begin_sync_heaps_after(mark), }; ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Recheck the heap-sync floor after deferred descriptor writes** With asynchronous heap sync enabled and the default `VICTORY_PORT_JOURNAL` setting, a queued submission can now reuse a round completed before preparation and receive `SyncedHeaps(None)` here. However, `run_deferred` subsequently executes `Step::Copy`, free `Step::Placed`, and `Step::RawCopy` operations that can write descriptor-heap memory. Their `prep_wrote()` calls raise the floor, but nothing rechecks it before `drop(heaps_synced)` at line 7484; that drop simply returns for `None`. Consequently, the submission can execute with stale host descriptors even though its preparation updated the title-side records. Revalidate the required round after deferred writes and any preparation-time landings, before sending the command lists. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot] commented 2026-11-27 18:36:50 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T18:36:50Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38c145b80a

ℹ️ 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".

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".

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review:6092155713 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/343#pullrequestreview-6092155713). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T18:36:50Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `38c145b80a` <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". 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". </details>
TaynanGT commented 2026-11-29 19:06:54 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T19:06:54Z.

Code review location: crates/victory-gpu/src/host.rs; line 7293

@@ -7237,10 +7284,11 @@ impl Host {
         // Descriptors the title copied into placed heaps directly, before
         // command lists that index those slots are submitted.
         // Renderer port #7 (from renderer patch #4): the round asked for when
-        // the title submitted it, if that is known (`crate::port_journal`).
+        // the title submitted it, if that is known (`crate::port_journal`),
+        // otherwise the enqueue-time `heap_sync` stamp (`SyncRounds`).
         let heaps_on = crate::port_journal::on();
         let heaps_synced = match crate::port_journal::needed() {
-            0 => crate::descriptor::begin_sync_heaps(),
+            0 => crate::descriptor::begin_sync_heaps_for(heap_sync),
             mark => crate::descriptor::begin_sync_heaps_after(mark),
         };

This is a correctness concern, not merely a performance issue. The current local submit path still begins heap synchronization before preparation and drops the guard later. The required round needs to be checked after deferred writes and before sending lists, with a regression for a reused completed round followed by a descriptor write. I am not treating this as resolved.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review-comment:4732744824 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/343#discussion_r4732744824). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T19:06:54Z. **Code review location:** `crates/victory-gpu/src/host.rs`; line 7293 ~~~~diff @@ -7237,10 +7284,11 @@ impl Host { // Descriptors the title copied into placed heaps directly, before // command lists that index those slots are submitted. // Renderer port #7 (from renderer patch #4): the round asked for when - // the title submitted it, if that is known (`crate::port_journal`). + // the title submitted it, if that is known (`crate::port_journal`), + // otherwise the enqueue-time `heap_sync` stamp (`SyncRounds`). let heaps_on = crate::port_journal::on(); let heaps_synced = match crate::port_journal::needed() { - 0 => crate::descriptor::begin_sync_heaps(), + 0 => crate::descriptor::begin_sync_heaps_for(heap_sync), mark => crate::descriptor::begin_sync_heaps_after(mark), }; ~~~~ --- This is a correctness concern, not merely a performance issue. The current local submit path still begins heap synchronization before preparation and drops the guard later. The required round needs to be checked after deferred writes and before sending lists, with a regression for a reused completed round followed by a descriptor write. I am not treating this as resolved.
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
TaynanGT/Vice-Tay!343
No description provided.