Shaders: bound RPF signature sampling by record count #1435

Open
anakatt wants to merge 1 commit from upstream-pr/1445 into main
anakatt commented 2026-11-24 16:07:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by anakatt on 2026-11-24T16:07:22Z.


I changed the RPF signature sample to count records rather than distinct signatures. Previously, an archive dominated by one signature could be decompressed in full even with --top 0.

What is in it

  • Sample the first 64 records; still unpack later records requested for listing or extraction.
  • Add a real CLI regression with 128 synthetic records, including a late listing/extraction match.
  • Document the sampling limit in README.

Tested

Windows 11 Pro ARM64 10.0.26100.1742, UTM VM with 4 GiB RAM, x64 Rust 1.100.0 (x86_64-pc-windows-msvc) under Windows emulation. No GPU is used by these checks.

I tested a source archive of main 930e8b49c1c2ec683d22c724a398b39111cd0e56 with the changed source/test files copied in, then committed those files as 776055a9a831df1bd3d4aee525255814369c52e6. These were not clean-checkout smoke runs.

Before the fix:

cargo test --locked -p xcl --test rpf_e2e signature_sampling_is_bounded_without_skipping_requested_records -- --exact --test-threads=4
0 passed; 1 failed; 0 ignored; 2 filtered out; 0 skipped

The CLI reported FSSM 127, LATE 1 instead of bounding its signature sample.

After the fix:

cargo test --locked -p xcl --test rpf_e2e -- --test-threads=4
3 passed; 0 failed; 0 ignored; 0 filtered out; 0 skipped

The regression checks the bounded summary, listing a record beyond the sample, and the exact bytes extracted from that record.

Regression run

Not run. I do not have generated xcl-smoke blocks from clean main and PR-head commits using the same title and duration. This remains a draft until the required regression runs are available.

Not tested

Full workspace suite, retail archives, performance timings, and real-title smoke runs. I have not measured loading-time or gameplay improvements.

AI use

omp, openai-codex/gpt-6-astra: investigated the sampling condition, implemented the fix and regression, ran the Windows VM checks, and prepared this PR.

<!-- greyfinch-sync:ivall/xcl:issue:5475830180 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1445). Originally posted by [anakatt](https://github.com/anakatt) on 2026-11-24T16:07:22Z. --- I changed the RPF signature sample to count records rather than distinct signatures. Previously, an archive dominated by one signature could be decompressed in full even with `--top 0`. ## What is in it - Sample the first 64 records; still unpack later records requested for listing or extraction. - Add a real CLI regression with 128 synthetic records, including a late listing/extraction match. - Document the sampling limit in README. ## Tested Windows 11 Pro ARM64 10.0.26100.1742, UTM VM with 4 GiB RAM, x64 Rust 1.100.0 (`x86_64-pc-windows-msvc`) under Windows emulation. No GPU is used by these checks. I tested a source archive of main `930e8b49c1c2ec683d22c724a398b39111cd0e56` with the changed source/test files copied in, then committed those files as `776055a9a831df1bd3d4aee525255814369c52e6`. These were not clean-checkout smoke runs. Before the fix: ```text cargo test --locked -p xcl --test rpf_e2e signature_sampling_is_bounded_without_skipping_requested_records -- --exact --test-threads=4 0 passed; 1 failed; 0 ignored; 2 filtered out; 0 skipped ``` The CLI reported `FSSM 127, LATE 1` instead of bounding its signature sample. After the fix: ```text cargo test --locked -p xcl --test rpf_e2e -- --test-threads=4 3 passed; 0 failed; 0 ignored; 0 filtered out; 0 skipped ``` The regression checks the bounded summary, listing a record beyond the sample, and the exact bytes extracted from that record. ## Regression run Not run. I do not have generated `xcl-smoke` blocks from clean main and PR-head commits using the same title and duration. This remains a draft until the required regression runs are available. ## Not tested Full workspace suite, retail archives, performance timings, and real-title smoke runs. I have not measured loading-time or gameplay improvements. ## AI use omp, openai-codex/gpt-6-astra: investigated the sampling condition, implemented the fix and regression, ran the Windows VM checks, and prepared this PR.
nnonno91 commented 2026-11-24 17:06:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-24T16:13:56Z.


Native Windows test report and archive benchmark for 776055a

Tested

  • Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, RTX 5090 (driver 617.42), Rust 1.100.0 MSVC, DXC 1.8.2502.11.
  • On clean head 776055a9a831df1bd3d4aee525255814369c52e6, cargo test --locked -p xcl --test rpf_e2e -- --test-threads=4 passed all 3 tests. The same new test on base 930e8b49c1c2ec683d22c724a398b39111cd0e56, with only its test code copied over and a separate Cargo target directory, failed as expected with FSSM 127, LATE 1.
  • cargo build --workspace --locked and cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output passed on the PR head. Cargo reported 752 passed, 0 failed, 41 ignored. Its pass count includes two GPU skips for lack of native wave64: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
  • I built both commits with cargo build --locked --release -p xcl --bin xcl and ran xcl rpf <synthetic archive> --full --top 0 in six alternating pairs after one warm-up per version. The archive contained 8,192 records of 64 KiB uncompressed, all but the last with the same signature.
Build Signatures reported Median elapsed time Range
Base FSSM 8191, LATE 1 55.24 ms 53.91–57.88 ms
PR FSSM 64 10.93 ms 9.55–11.30 ms

The PR also listed the final record with --find and extracted it with --extract. All 65,536 extracted bytes matched the fixture.

Not tested

  • Retail archives, gameplay or smoke runs. The benchmark measures the synthetic CLI workload above.
  • I tested the exact draft head. Merging it into main at b7aa9f3 has a conflict in README.md.

AI use

  • OpenAI Codex (GPT-6, exact model variant unavailable) ran the tests and prepared this report.
<!-- greyfinch-sync:ivall/xcl:comment:7137329223 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1445#issuecomment-7137329223). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-24T16:13:56Z. --- ### Native Windows test report and archive benchmark for `776055a` **Tested** - Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, RTX 5090 (driver 617.42), Rust 1.100.0 MSVC, DXC 1.8.2502.11. - On clean head `776055a9a831df1bd3d4aee525255814369c52e6`, `cargo test --locked -p xcl --test rpf_e2e -- --test-threads=4` passed all 3 tests. The same new test on base `930e8b49c1c2ec683d22c724a398b39111cd0e56`, with only its test code copied over and a separate Cargo target directory, failed as expected with `FSSM 127, LATE 1`. - `cargo build --workspace --locked` and `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output` passed on the PR head. Cargo reported **752 passed, 0 failed, 41 ignored**. Its pass count includes two GPU skips for lack of native wave64: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. - I built both commits with `cargo build --locked --release -p xcl --bin xcl` and ran `xcl rpf <synthetic archive> --full --top 0` in six alternating pairs after one warm-up per version. The archive contained 8,192 records of 64 KiB uncompressed, all but the last with the same signature. | Build | Signatures reported | Median elapsed time | Range | | --- | --- | ---: | ---: | | Base | `FSSM 8191, LATE 1` | 55.24 ms | 53.91–57.88 ms | | PR | `FSSM 64` | 10.93 ms | 9.55–11.30 ms | The PR also listed the final record with `--find` and extracted it with `--extract`. All 65,536 extracted bytes matched the fixture. **Not tested** - Retail archives, gameplay or smoke runs. The benchmark measures the synthetic CLI workload above. - I tested the exact draft head. Merging it into `main` at `b7aa9f3` has a conflict in `README.md`. **AI use** - OpenAI Codex (GPT-6, exact model variant unavailable) ran the tests and prepared this report.
DavidM1911 commented 2026-11-24 19:07:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:54:13Z.


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7141313514 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1445#issuecomment-7141313514). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:54:13Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Toons29 commented 2026-11-25 04:10:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:31:33Z.


Regression run of 776055a9 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 776055a9a831df1bd3d4aee525255814369c52e6
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1632 (PresentX 1632)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14685 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 99 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7151995687 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1445#issuecomment-7151995687). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:31:33Z. --- Regression run of `776055a9` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 776055a9a831df1bd3d4aee525255814369c52e6 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1632 (PresentX 1632) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14685 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 99 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
github-actions[bot] commented 2026-11-28 08:01:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:58Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7236317219 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1445#issuecomment-7236317219). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:01:58Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 05:46:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:46:38Z.


Triage (#1607) – head 776055a

No open or merged PR makes the same change. In rpf.rs::run, main still bounds the sample with by_magic.len() > 64 (distinct signatures), so an archive with few signatures has every record inflated. Bounding it by record index matches the 'from a sample' output. The new rpf_e2e test fails without the fix (it would print LATE).
Only the PR description check fails. The Shaders: prefix does not fit an xcl rpf change. The PR conflicts with main.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302126693 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1445#issuecomment-7302126693). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:46:38Z. --- **Triage (#1607)** – head 776055a No open or merged PR makes the same change. In `rpf.rs::run`, `main` still bounds the sample with `by_magic.len() > 64` (distinct signatures), so an archive with few signatures has every record inflated. Bounding it by record index matches the 'from a sample' output. The new `rpf_e2e` test fails without the fix (it would print `LATE`). Only the `PR description` check fails. The `Shaders:` prefix does not fit an `xcl rpf` change. The PR conflicts with `main`. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/1445:upstream-pr/1445'
git switch 'upstream-pr/1445'

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/1445'
git switch 'upstream-pr/1445'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1445'
git switch 'upstream-pr/1445'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1445'
git switch 'main'
git merge --squash 'upstream-pr/1445'
git switch 'main'
git merge --ff-only 'upstream-pr/1445'
git switch 'main'
git merge 'upstream-pr/1445'
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
xcl-dev/xcl!1435
No description provided.