Game: preserve sample masks in prebuilt graphics pipelines #1866

Open
github-bot wants to merge 5 commits from github-bot/gh-1866 into main AGit
Owner

@⁠necrobytes on GitHub · 2026-11-24 23:47 UTC · original
necrobytes:fix/prebuild-sample-mask → main · +19 −7 · 1 files · 5 commits · open

translate --cache --pipelines used to write 0xffffffff into every graphics pipeline’s sample-mask field. A four-sample record with mask 0x5 therefore looked the same as one enabling all four samples. The runtime includes the mask in its pipeline cache key, so a request for the partial mask could miss the prebuilt entry.

The prebuilder now copies the mask returned by Graphics::samples() into the creation stream. The existing stream test now checks partial, zero, and full coverage on a four-sample record.

I tested on x86-64 Linux with Rust 1.98.1. A synthetic pack with masks 0, 1, 5, and 0xffffffff produced one distinct stream on 70564ae. With this change, it produced four, each carrying the original mask.

  • All 15 victory-game tests passed natively on Linux. I also cross-compiled the tests for x86_64-pc-windows-gnu and ran the Windows executable under Wine 11.21. All 15 passed there too. The new 0x5 assertion failed on the original implementation.
  • From Linux, cargo clippy --locked --workspace --all-targets --target x86_64-pc-windows-msvc -- -D warnings passed both with default features and with --all-features. Strict Clippy also passed for victory-game on the Linux target.
  • cargo xtask policy passed for all 174 tracked files.

Tracked as NEW-41. Claim in #1633

Implemented and tested with Codex.

**@⁠necrobytes** on GitHub · 2026-11-24 23:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/1866) `necrobytes:fix/prebuild-sample-mask` → `main` · +19 −7 · 1 files · 5 commits · open `translate --cache --pipelines` used to write `0xffffffff` into every graphics pipeline’s sample-mask field. A four-sample record with mask `0x5` therefore looked the same as one enabling all four samples. The runtime includes the mask in its pipeline cache key, so a request for the partial mask could miss the prebuilt entry. The prebuilder now copies the mask returned by `Graphics::samples()` into the creation stream. The existing stream test now checks partial, zero, and full coverage on a four-sample record. I tested on x86-64 Linux with Rust 1.98.1. A synthetic pack with masks `0`, `1`, `5`, and `0xffffffff` produced one distinct stream on `70564ae`. With this change, it produced four, each carrying the original mask. - All 15 `victory-game` tests passed natively on Linux. I also cross-compiled the tests for `x86_64-pc-windows-gnu` and ran the Windows executable under Wine 11.21. All 15 passed there too. The new `0x5` assertion failed on the original implementation. - From Linux, `cargo clippy --locked --workspace --all-targets --target x86_64-pc-windows-msvc -- -D warnings` passed both with default features and with `--all-features`. Strict Clippy also passed for `victory-game` on the Linux target. - `cargo xtask policy` passed for all 174 tracked files. Tracked as `NEW-41`. [Claim in #1633](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633) Implemented and tested with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:47:02 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 07:18 UTC · original · edited 2026-11-25 20:20 UTC

Automated triage for the maintainers.

Merge candidate. The verdict is unchanged.

Since the last review (1f34644 → 771bb01): the only new commit merges current main into the branch. The PR's own diff against main is the same as before.

stream in crates/victory-game/src/pipelines.rs writes the sample mask from Graphics::samples() (metadata offset 0x1c) into the stream's sample-mask field at 0x1dc, instead of always writing u32::MAX. crates/victory-gpu/src/pipeline/host.rs reads that field into sample_mask and the pipeline key. The test now builds records with masks 0x5, 0 and u32::MAX and checks that each one reaches the stream.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 07:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1866#issuecomment-7155718348) · edited 2026-11-25 20:20 UTC <!-- victory-triage v1 head=771bb01665ab4209fa321b0f8960dabde5586257 verdict=merge-candidate at=2026-11-25T20:18:54Z --> Automated triage for the maintainers. **Merge candidate.** The verdict is unchanged. **Since the last review (`1f34644` → `771bb01`):** the only new commit merges current `main` into the branch. The PR's own diff against `main` is the same as before. `stream` in `crates/victory-game/src/pipelines.rs` writes the sample mask from `Graphics::samples()` (metadata offset 0x1c) into the stream's sample-mask field at 0x1dc, instead of always writing `u32::MAX`. `crates/victory-gpu/src/pipeline/host.rs` reads that field into `sample_mask` and the pipeline key. The test now builds records with masks 0x5, 0 and `u32::MAX` and checks that each one reaches the stream. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠catminou4 on GitHub · 2026-11-25 02:09 UTC · original · approved these changes

Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (940d32f), cargo test → 15 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows.

victory-game. Game: preserve sample masks in prebuilt graphics…: sample-mask preservation in prebuilt shaders.

**@⁠catminou4** on GitHub · 2026-11-25 02:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1866#pullrequestreview-6050606378) · **approved these changes** Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (940d32f), cargo test → 15 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows. victory-game. Game: preserve sample masks in prebuilt graphics…: sample-mask preservation in prebuilt shaders.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 19:24 UTC · original · approved these changes

Verified locally merged onto origin/main (63bcca43, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test --locked -p victory-game — 15 passed, 0 failed (including a_record_becomes_the_engines_creation_stream across sample masks 0x5, 0, and u32::MAX)
  • cargo clippy --locked -p victory-game --all-targets -- -D warnings (default and --all-features) — 0 warnings
  • rustfmt --edition 2024 --check crates/victory-game/src/pipelines.rs — clean
  • cargo xtask policy — ok (191 files ok)

Review notes

  • stream() now forwards the little-endian u32 sample mask from Graphics::samples() (0x1c in metadata) straight into offset 0x1dc instead of overwriting it with u32::MAX, preserving 0, partial masks, and u32::MAX alike.
**@⁠fuzeofficlal** on GitHub · 2026-11-26 19:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/1866#pullrequestreview-6079495751) · **approved these changes** Verified locally merged onto `origin/main` (`63bcca43`, Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test --locked -p victory-game` — **15 passed, 0 failed** (including `a_record_becomes_the_engines_creation_stream` across sample masks `0x5`, `0`, and `u32::MAX`) - `cargo clippy --locked -p victory-game --all-targets -- -D warnings` (default and `--all-features`) — 0 warnings - `rustfmt --edition 2024 --check crates/victory-game/src/pipelines.rs` — clean - `cargo xtask policy` — ok (`191 files ok`) ### Review notes - `stream()` now forwards the little-endian `u32` sample mask from `Graphics::samples()` (`0x1c` in metadata) straight into offset `0x1dc` instead of overwriting it with `u32::MAX`, preserving `0`, partial masks, and `u32::MAX` alike.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1866/head:github-bot/gh-1866'
git switch 'github-bot/gh-1866'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1866'
git switch 'github-bot/gh-1866'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1866'
git switch 'github-bot/gh-1866'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1866'
git switch 'main'
git merge --squash 'github-bot/gh-1866'
git switch 'main'
git merge --ff-only 'github-bot/gh-1866'
git switch 'main'
git merge 'github-bot/gh-1866'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1866
No description provided.