Skip to content

R-7: take a lane mask copied back one half at a time as the mask copied - #55

Open
sanchaton wants to merge 1 commit into
ProjectLeonidaL:mainfrom
sanchaton:pr/r7-lane-mask
Open

sanchaton wants to merge 1 commit into
ProjectLeonidaL:mainfrom
sanchaton:pr/r7-lane-mask

Conversation

@sanchaton

Copy link
Copy Markdown
Contributor

What changed

R-7 (partial): the 3 programs that failed on lane masks now translate: CS_TransmissionVolumetrics and CS_TransmissionVolumetricsSubmerged ("emit: a lane mask holding lanes elsewhere read as data") and PS_VoxelizeVisiblity ("emit: an opaque lane mask"). They park a 64-bit lane mask in VGPR lanes and read it back one half at a time (ir::unspill turns the two v_readlane_b32 into two s_mov_b32). Structurisation now takes a pair whose halves are copied from s[n] and s[n+1] of one pair as the mask of that pair. Exact, no shortcut:.

How it was tested

  • Not run in game: tests and a full shader census only. The draws these shaders bring back have not been measured in game yet; no frame-rate change is claimed.

Checks run on this branch:

  • cargo test --workspace --locked: 656 passed, 0 failed, 18 ignored (run with -j 2 -- --test-threads=4)
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo xtask policy

New unit test: structure::tests::a_mask_copied_one_half_at_a_time_is_the_mask_copied (vcc copied half by half into s[2:3] is the comparison's mask; with s_mov_b32 s3, 0 it is not).

Full leonida translate --list --validate --jobs 2 with a release build, compared program by program with the census of the base tree (together with the POPS fix sent as a separate PR):

Cause Before After
emit: a lane mask holding lanes elsewhere read as data 2 0
emit: an opaque lane mask 1 0
emit: a hardware SGPR input (other PR) 10 0
All translation failures 282 269

No program that translated before fails now, and none changed its cause. The 216 DXIL validator failures are the same 216 programs, with the same messages, on the base commit; none of the 3 fixed programs is among them.

AI

  • AI-assisted: investigation, fix, unit test, census comparison and review.

…he mask copied

A 64-bit mask parked in VGPR lanes and read back with two s_mov_b32 (ir::unspill) was an opaque atom. Structurisation now follows such a pair to the mask it copies when both halves come from adjacent halves of one pair. CS_TransmissionVolumetrics, CS_TransmissionVolumetricsSubmerged and PS_VoxelizeVisiblity translate and validate.
@ShinniUwU

Copy link
Copy Markdown
Contributor

Looks good to me. Heads up: this and #56 both add their section at the top of "Newest" in docs/fork-notes.md, so whichever merges second will need a quick rebase.

@sanchaton

Copy link
Copy Markdown
Contributor Author

Thanks. Yes, #55 and #56 both put their note at the top of "Newest" in docs/fork-notes.md; I will rebase whichever one is merged second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants