test(lower): DEPBAR's scoreboard-list form and CS2R SRZ into high registers lower #212

Merged
HumanBean merged 1 commit from TrashPanda/Longshot:test/lower-cs2r-depbar into main 2026-12-04 17:52:24 +00:00
Member

Summary

Mesh-stage programs used to fail to lower on a first start, because of the list form of the scoreboard wait
(DEPBAR.LE SB0, 0x0, {4,3,2,1}) and CS2R Rd, SRZ into high registers. Longshot's lowering handles both now, but no
check covers them, so a later change to lower_to_maxwell.h could break them again without anyone noticing. This adds
a game-free check that lowers hand-made programs using both forms, so a regression fails the checks instead of a
player's first start. Nothing the game runs changes.

Read tests/test_lower_cs2r_depbar.py (new): it lowers the programs and checks the REGMAP_nx2 prefixes and the
MOV32I words the lowering writes. It comes from Hookshot's fix/lower-cs2r-depbar; that branch's lowering change
isn't needed, since main already has it (f174cfcf, from Hookshot's AMD fixes).

Testing

Tested: Linux (Ubuntu 26.04.1, g++ and clang 21), on main @ 068fb8eb: tests/test_lower_cs2r_depbar.py passes.
The full suite hasn't been run on this head yet; CI runs it on this push.

Still to test: None: a new check only, and nothing the game runs changes.

Measurements

Nothing to measure: a new game-free check, and nothing the game runs changes.

Risks

Nothing in the game: a new check only. A revert removes it. Nothing changes for a player.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Nothing the game runs changes.)
  • mise run test passes (any failure that also fails on main is named). (Not run on this head yet; CI's run on the push.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
## Summary Mesh-stage programs used to fail to lower on a first start, because of the list form of the scoreboard wait (`DEPBAR.LE SB0, 0x0, {4,3,2,1}`) and `CS2R Rd, SRZ` into high registers. Longshot's lowering handles both now, but no check covers them, so a later change to `lower_to_maxwell.h` could break them again without anyone noticing. This adds a game-free check that lowers hand-made programs using both forms, so a regression fails the checks instead of a player's first start. Nothing the game runs changes. Read `tests/test_lower_cs2r_depbar.py` (new): it lowers the programs and checks the `REGMAP_nx2` prefixes and the `MOV32I` words the lowering writes. It comes from Hookshot's `fix/lower-cs2r-depbar`; that branch's lowering change isn't needed, since `main` already has it (`f174cfcf`, from Hookshot's AMD fixes). ## Testing **Tested:** Linux (Ubuntu 26.04.1, g++ and clang 21), on `main` @ 068fb8eb: `tests/test_lower_cs2r_depbar.py` passes. The full suite hasn't been run on this head yet; CI runs it on this push. **Still to test:** None: a new check only, and nothing the game runs changes. ## Measurements Nothing to measure: a new game-free check, and nothing the game runs changes. ## Risks Nothing in the game: a new check only. A revert removes it. Nothing changes for a player. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. (Nothing the game runs changes.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (Not run on this head yet; CI's run on the push.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers.
TrashPanda changed title from WIP: test(lower): DEPBAR's scoreboard-list form and CS2R SRZ into high registers lower to test(lower): DEPBAR's scoreboard-list form and CS2R SRZ into high registers lower 2026-11-13 14:23:36 +00:00
TrashPanda force-pushed test/lower-cs2r-depbar from 67a159d177
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 765e5db3ad
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-13 14:45:21 +00:00
Compare
TrashPanda force-pushed test/lower-cs2r-depbar from 765e5db3ad
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 066e1f2cb7
Some checks failed
PR description / Description follows the template (pull_request_target) Failing after 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-16 14:18:29 +00:00
Compare
Member

Basic code-only review of 066e1f2cb7cb0ffa7eebfa73a324be02c18810ca; informational feedback, with final approval left to another reviewer.

No obvious defect found in this test-only addition. The fixture calls the real LowerToMaxwell implementation: it accepts the old and scoreboard-list DEPBAR forms, rejects an out-of-mask mode, verifies the direct R238/R239 zero writes, and checks both zero writes and register-map prefixes for R246–R252. Removing CS2R renaming or restoring the old DEPBAR rejection would fail these assertions. No existing assertions or production code are changed.

Current main retains the relevant lowering behavior and does not already contain this test. The script only writes its temporary fixture, invokes the selected compiler, and runs that fixture; there are no downloads or game-file accesses.

The reported Linux clang++ pass supports the fixture, but I have not reproduced it. Coverage stops at emitted lowering words, not downstream shader execution or rendering. The description's two baseline suite failures should be named for traceability; this is a reporting follow-up rather than a defect in these assertions.

No tests or builds run during this review.

Basic code-only review of 066e1f2cb7cb0ffa7eebfa73a324be02c18810ca; informational feedback, with final approval left to another reviewer. No obvious defect found in this test-only addition. The fixture calls the real `LowerToMaxwell` implementation: it accepts the old and scoreboard-list DEPBAR forms, rejects an out-of-mask mode, verifies the direct R238/R239 zero writes, and checks both zero writes and register-map prefixes for R246–R252. Removing CS2R renaming or restoring the old DEPBAR rejection would fail these assertions. No existing assertions or production code are changed. Current main retains the relevant lowering behavior and does not already contain this test. The script only writes its temporary fixture, invokes the selected compiler, and runs that fixture; there are no downloads or game-file accesses. The reported Linux clang++ pass supports the fixture, but I have not reproduced it. Coverage stops at emitted lowering words, not downstream shader execution or rendering. The description's two baseline suite failures should be named for traceability; this is a reporting follow-up rather than a defect in these assertions. No tests or builds run during this review.
TrashPanda force-pushed test/lower-cs2r-depbar from 066e1f2cb7
Some checks failed
PR description / Description follows the template (pull_request_target) Failing after 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 16b3543ed9
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-17 13:30:37 +00:00
Compare
Author
Member

Rebased onto main @ 544229a2 (now 16b3543e) and moved the description to the current template. Thanks @bibiburl: the suite failures that also fail on main are now named under Testing. On the rebased branch the new check passes and run_all.py fails 43 checks, all of which fail on main at the same commit too.

Rebased onto main @ 544229a2 (now 16b3543e) and moved the description to the current template. Thanks @bibiburl: the suite failures that also fail on main are now named under Testing. On the rebased branch the new check passes and run_all.py fails 43 checks, all of which fail on main at the same commit too.
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: the author ran the new check and run_all.py on Linux with g++ at the rebased head.
  • Nothing gets worse that I know of: ticked: Measurements gives a one-line reason there is nothing to measure: a new check only, with no game change.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: the author ran the new check and run_all.py on Linux with g++ at the rebased head. - *Nothing gets worse that I know of*: ticked: Measurements gives a one-line reason there is nothing to measure: a new check only, with no game change.
TrashPanda force-pushed test/lower-cs2r-depbar from 16b3543ed9
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to c74e79f967
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 7s
2026-11-20 02:17:52 +00:00
Compare
HumanBean deleted branch test/lower-cs2r-depbar 2026-12-04 17:52:24 +00:00
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 7s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
MagicBeanDev/Longshot!212
No description provided.