CLI: schedule each pipeline key once per prebuild #3568

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3568 into main
andrewpozdnakov7-jpg commented 2026-11-27 18:22:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T18:22:03Z.


Two records in a shader pack can resolve to the same pipeline key. The prebuild used to send each record to a worker. On a cold cache, the first worker creates the pipeline and the others can repeat the work of loading it from the host library.

Schedule one job per key and report how many records share a key. Pipelines from the early list still go first. The diagnostic key listing keeps one row per pack record.

I compared main 63bcca4 with this patch through victory translate --cache --pipelines --jobs 4 on Windows with Agility and WARP. The generated pack has 17 compute records and two distinct keys.

Run main Patch
Cold 2 created, 15 library loads 2 created, 0 library loads
Warm 17 records counted as already present 2 keys already present, 15 duplicate records

Both runs saved the same two prebuilt keys. VICTORY_PREBUILD_KEYS produced the same 17 records before and after the change. This fixture measures work counts. A title-sized timing comparison remains open.

All 18 application tests passed in both feature configurations. Strict Clippy and the asset policy passed. #2787 changes the same scheduling block, so combining the two patches requires a merge there.

Coordination claim

AI-assisted with Codex. Please retain the Git author if reapplying this change. If folding it into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5531303737 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3568). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T18:22:03Z. --- Two records in a shader pack can resolve to the same pipeline key. The prebuild used to send each record to a worker. On a cold cache, the first worker creates the pipeline and the others can repeat the work of loading it from the host library. Schedule one job per key and report how many records share a key. Pipelines from the early list still go first. The diagnostic key listing keeps one row per pack record. I compared `main` `63bcca4` with this patch through `victory translate --cache --pipelines --jobs 4` on Windows with Agility and WARP. The generated pack has 17 compute records and two distinct keys. | Run | `main` | Patch | | --- | --- | --- | | Cold | 2 created, 15 library loads | 2 created, 0 library loads | | Warm | 17 records counted as already present | 2 keys already present, 15 duplicate records | Both runs saved the same two prebuilt keys. `VICTORY_PREBUILD_KEYS` produced the same 17 records before and after the change. This fixture measures work counts. A title-sized timing comparison remains open. All 18 application tests passed in both feature configurations. Strict Clippy and the asset policy passed. #2787 changes the same scheduling block, so combining the two patches requires a merge there. [Coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7225336006) AI-assisted with Codex. Please retain the Git author if reapplying this change. If folding it into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
andrewpozdnakov7-jpg commented 2026-11-27 18:25:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T18:25:04Z.


Windows CI passed on 3a8c8ab.

With 17 synthetic records for two keys, the cold run still made both pipelines and avoided the 15 redundant library loads. The warm run found both saved keys. All 17 diagnostic rows match the control. A one-worker run also confirmed that a key seeded in the early list is made first.

Next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7225466373 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3568#issuecomment-7225466373). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T18:25:04Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46048933530/job/140675112618) passed on `3a8c8ab`. With 17 synthetic records for two keys, the cold run still made both pipelines and avoided the 15 redundant library loads. The warm run found both saved keys. All 17 diagnostic rows match the control. A one-worker run also confirmed that a key seeded in the early list is made first. Next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit.
pickles976 commented 2026-11-27 18:47:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T18:47:49Z.


Verified the dedup mechanism on this Wine/RTX 4060 Laptop using production #3568 head 3a8c8ab9b8 plus the previously verified #1722 null-blob empty-library bootstrap. This is a dirty local integration, not an exact-head pass; the only added production behavior is that Wine prerequisite. Local CLI fixture and test-only dev-dependency/lockfile changes are retained.

One bounded CLI integration test passed (0 ignored, 6.84 s, fresh intended-tree build 8.61 s). The synthetic input has 17 records representing two distinct pipeline keys, with different identifying instruction prefixes and thread-group metadata to avoid conflating this with #3521's primary-container fix.

Observed/asserted:

  • Diagnostic mode retains all 17 per-record rows with exact identities.
  • One-worker cold run creates exactly two native PSOs, zero duplicate library loads; the key in early-pipelines.txt is built first.
  • Fresh warm CLI process reports both keys already present, schedules no pipeline build records, and preserves the exact persisted key set.
  • Four-worker cold run also creates exactly two PSOs, zero duplicate loads, and persists those two keys.
  • Real physical NVIDIA device required through the D3D12 device's adapter LUID/vendor/software flags; native DXVK logs also identify RTX 4060 Laptop.

This verifies actual CLI scheduling/library creation/persistence, not shader dispatch, a retail-size corpus, matched-parent timing, measured loading RAM/stutter improvement, or gameplay. Initial attempts failed on my added fixture's lockfile entries, missing identifying v_nop prefixes, and an adapter-log assertion that incorrectly assumed Wine native logs are captured in the Windows child's stderr. Those harness issues were corrected; they are not PR failures.

Linux 6.17, Wine 11, NVIDIA 590.48.1, 16 GiB RAM/8 GiB VRAM; diagnostic-relaxed-vtable vkd3d 2576c0b4adfae4a+, not stock certification. Vendor unmasked; all existing guards retained. Sampled GPU peak290 MiB, available RAM minimum11143.4 MiB, disk minimum11.493 GiB. Evidence .compat-runtime/logs/verify-victory3568-prebuild-dedup-native-20261127T184605Z/.

Next meaningful performance comparison is a matched real-corpus cold/warm workload on a runtime-cleared rendering stack, without treating already-present counters as shader execution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7225880642 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3568#issuecomment-7225880642). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T18:47:49Z. --- Verified the dedup mechanism on this Wine/RTX 4060 Laptop using production #3568 head 3a8c8ab9b853fae82f256c0ebb475ce6393d28d7 **plus the previously verified #1722 null-blob empty-library bootstrap**. This is a dirty local integration, not an exact-head pass; the only added production behavior is that Wine prerequisite. Local CLI fixture and test-only dev-dependency/lockfile changes are retained. One bounded CLI integration test passed (0 ignored, 6.84 s, fresh intended-tree build 8.61 s). The synthetic input has 17 records representing two distinct pipeline keys, with different identifying instruction prefixes and thread-group metadata to avoid conflating this with #3521's primary-container fix. Observed/asserted: - Diagnostic mode retains all 17 per-record rows with exact identities. - One-worker cold run creates exactly two native PSOs, zero duplicate library loads; the key in early-pipelines.txt is built first. - Fresh warm CLI process reports both keys already present, schedules no pipeline build records, and preserves the exact persisted key set. - Four-worker cold run also creates exactly two PSOs, zero duplicate loads, and persists those two keys. - Real physical NVIDIA device required through the D3D12 device's adapter LUID/vendor/software flags; native DXVK logs also identify RTX 4060 Laptop. This verifies actual CLI scheduling/library creation/persistence, not shader dispatch, a retail-size corpus, matched-parent timing, measured loading RAM/stutter improvement, or gameplay. Initial attempts failed on my added fixture's lockfile entries, missing identifying v_nop prefixes, and an adapter-log assertion that incorrectly assumed Wine native logs are captured in the Windows child's stderr. Those harness issues were corrected; they are not PR failures. Linux 6.17, Wine 11, NVIDIA 590.48.1, 16 GiB RAM/8 GiB VRAM; diagnostic-relaxed-vtable vkd3d 2576c0b4adfae4a+, not stock certification. Vendor unmasked; all existing guards retained. Sampled GPU peak290 MiB, available RAM minimum11143.4 MiB, disk minimum11.493 GiB. Evidence `.compat-runtime/logs/verify-victory3568-prebuild-dedup-native-20261127T184605Z/`. Next meaningful performance comparison is a matched real-corpus cold/warm workload on a runtime-cleared rendering stack, without treating already-present counters as shader execution.
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/3568:upstream-pr/3568'
git switch 'upstream-pr/3568'

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