Shaders/own_bits: fix STALE taint propagation for control-dependent a… #516

Open
github-bot wants to merge 1 commit from github-bot/gh-516 into main AGit
Owner

@⁠pug205gti6 on GitHub · 2026-11-25 01:57 UTC · original
pug205gti6:pr/441-shaders-own-bits → main · +181 −10 · 1 files · 1 commits · open

…nd loop-carried mask phis

In own_bits::Ctx::site, the STALE check missed test-dependent lane masks that outlived their round in three ways:

  1. dep propagation over st.phi_masks only checked the BDD support of incoming edge values, missing control-dependent mask phis whose per-edge given(m, edge) folded to constants (TRUE/FALSE) across a tainted branch or path.
  2. The block check skipped every block in lp dominated by a test block tb. Because the own-bit test normally lives in the loop header (tb == h), self.dominates(tb, b) skipped every block in lp, including guards/uses before ti in tb and loop-carried mask phis at h.
  3. The st.masks user check only flagged User::Phi(b2, k2) when !lp[b2], ignoring live loop-header phis at b2 == h.

Propagate control-dependent taint into st.phi_masks when incoming edge values differ and a predecessor's reachability or branch condition is tainted, reject tainted loop-header mask phis at h, check guards and instruction mask users against instruction-level dominance after (tb, ti), and treat live phi users at h as leaving the round. Add synthetic unit tests covering control-dependent loop-carried, control-dependent post-loop, and direct data-dependent loop-carried tainted masks.

**@⁠pug205gti6** on GitHub · 2026-11-25 01:57 UTC · [original](https://github.com/fxceless/victory-fork/pull/516) `pug205gti6:pr/441-shaders-own-bits` → `main` · +181 −10 · 1 files · 1 commits · open …nd loop-carried mask phis In `own_bits::Ctx::site`, the `STALE` check missed test-dependent lane masks that outlived their round in three ways: 1. `dep` propagation over `st.phi_masks` only checked the BDD support of incoming edge values, missing control-dependent mask phis whose per-edge `given(m, edge)` folded to constants (`TRUE`/`FALSE`) across a tainted branch or path. 2. The block check skipped every block in `lp` dominated by a test block `tb`. Because the own-bit test normally lives in the loop header (`tb == h`), `self.dominates(tb, b)` skipped every block in `lp`, including guards/uses before `ti` in `tb` and loop-carried mask phis at `h`. 3. The `st.masks` user check only flagged `User::Phi(b2, k2)` when `!lp[b2]`, ignoring live loop-header phis at `b2 == h`. Propagate control-dependent taint into `st.phi_masks` when incoming edge values differ and a predecessor's reachability or branch condition is tainted, reject tainted loop-header mask phis at `h`, check guards and instruction mask users against instruction-level dominance after `(tb, ti)`, and treat live phi users at `h` as leaving the round. Add synthetic unit tests covering control-dependent loop-carried, control-dependent post-loop, and direct data-dependent loop-carried tainted masks.
In `own_bits::Ctx::site`, the `STALE` check missed test-dependent lane masks that outlived their round in three ways:
1. `dep` propagation over `st.phi_masks` only checked the BDD support of incoming edge values, missing control-dependent mask phis whose per-edge `given(m, edge)` folded to constants (`TRUE`/`FALSE`) across a tainted branch or path.
2. The block check skipped every block in `lp` dominated by a test block `tb`. Because the own-bit test normally lives in the loop header (`tb == h`), `self.dominates(tb, b)` skipped every block in `lp`, including guards/uses before `ti` in `tb` and loop-carried mask phis at `h`.
3. The `st.masks` user check only flagged `User::Phi(b2, k2)` when `!lp[b2]`, ignoring live loop-header phis at `b2 == h`.

Propagate control-dependent taint into `st.phi_masks` when incoming edge values differ and a predecessor's reachability or branch condition is tainted, reject tainted loop-header mask phis at `h`, check guards and instruction mask users against instruction-level dominance after `(tb, ti)`, and treat live phi users at `h` as leaving the round. Add synthetic unit tests covering control-dependent loop-carried, control-dependent post-loop, and direct data-dependent loop-carried tainted masks.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:45:08 +00:00
Author
Owner

@⁠Revens2 on GitHub · 2026-11-25 07:36 UTC · original

Duplicate of #441: @⁠AscilCH opened this patch 65 minutes earlier, and gh pr diff returns the same bytes for both (+181/-10 on 1 file(s), same title).

Please continue in #441 so the review history and any test data stay in one place.
Thanks.

**@⁠Revens2** on GitHub · 2026-11-25 07:36 UTC · [original](https://github.com/fxceless/victory-fork/pull/516#issuecomment-7156047195) Duplicate of #441: @⁠AscilCH opened this patch 65 minutes earlier, and `gh pr diff` returns the same bytes for both (+181/-10 on 1 file(s), same title). Please continue in #441 so the review history and any test data stay in one place. Thanks.
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-25 07:51 UTC · original

Independent verification: PR #516 (Shaders/own_bits: fix STALE taint propagation for control-dependent and loop-carried mask phis) merges cleanly onto main (8dd30ab). Build: success. Tests: 172/172 shader tests pass; full workspace tests fail on Linux due to known Windows-only dependency issue (unrelated to PR). Only 1 file modified: crates/victory-shader/src/emit/own_bits.rs (+181, -10). PR is clean and ready to merge. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.

**@⁠Headache3318** on GitHub · 2026-11-25 07:51 UTC · [original](https://github.com/fxceless/victory-fork/pull/516#issuecomment-7156336176) Independent verification: PR #516 (Shaders/own_bits: fix STALE taint propagation for control-dependent and loop-carried mask phis) merges cleanly onto main (8dd30ab). Build: success. Tests: 172/172 shader tests pass; full workspace tests fail on Linux due to known Windows-only dependency issue (unrelated to PR). Only 1 file modified: crates/victory-shader/src/emit/own_bits.rs (+181, -10). PR is clean and ready to merge. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.
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/516/head:github-bot/gh-516'
git switch 'github-bot/gh-516'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-516'
git switch 'github-bot/gh-516'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-516'
git switch 'github-bot/gh-516'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-516'
git switch 'main'
git merge --squash 'github-bot/gh-516'
git switch 'main'
git merge --ff-only 'github-bot/gh-516'
git switch 'main'
git merge 'github-bot/gh-516'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.