Shaders: read the merged stage's LDS size, bound GS vertices (#311) #367
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!367
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-367"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Revens2 on GitHub · 2026-11-24 23:57 UTC · original
Revens2:fix/issue-311→main· +943 −13 · 8 files · 4 commits · openStep 2 of #138, for #311. Stacked on #309: this branch starts from #309's, so until #309 merges the diff here includes its commits (and the review fix on it); the commit of this step is the last one. The base is
mainbecause the stacked branch is not in this repository.What is in it
StageIo::Es(MergedIo)andStageIo::Gs(MergedIo): the record of either half of a merged stage now gives its LDS bytes (the common record field, as mesh programs already read it). The other stage data after the record (output signature rows, limits) is in a layout nothing in the tree has a fixture for, so it is not read.merged::limits(program): from the code, the vertices a GS program emits along its longest path (s_sendmsgGS_EMIT / GS_EMIT_CUT), the streams used, whether it cuts; a message inside a loop or a program that emits nothing is refused.merged::GsMessagedecodes the geometry messages (message, operation and stream bits ofsimm16).MergedGs::lds_bytes(): the larger of the two records' LDS size.io::raiseaccepts an ES program (no exports, runtime table input only).victory translate: thegeometrysection gains a line with how many GS programs have a bounded vertex count in their code and the largest bound.Tested
cargo build --workspace --locked,cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 517 passed, 0 failed, 7 ignored (Windows). One unrelatedvictory-gpuin-place WARP test failed in a first run and passed in the rerun of that crate and in the full run.Not tested
victory translateover the title: not run, so the new bounded-count line is unmeasured.Still to do: #312 (ES half, LDS handoff), #313 (GS output as DXIL stream emits), #314 (pipeline path); #138 stays open.
AI use
Written with Claude Code (Claude Sonnet 5.5). The tests are synthetic programs; no title shaders or game files were read.
@Revens2 on GitHub · 2026-11-25 00:18 UTC · original
Both review findings fixed in d8e53e1 (with tests):
merged.rs):limitsnow refuses a GS program with an indirect jump (an unresolved jump in a geometry program) instead of counting only the emits before it.io.rs,merged.rs): the overlap tests saturate the container-supplied SGPR count; a test pairs two halves with au32::MAXcount and gets a refusal rather than a wrap.cargo test -p victory-shader --locked: 233 passed, 0 failed.@Revens2 on GitHub · 2026-11-25 07:10 UTC · original
Rebased on main (
a26859f), stacked on #309; head now4399972. No new conflicts beyond the ones in #309.cargo build --workspace --lockedok;cargo test -p victory-shader -p victory-gpu --locked: 137 + 238 passed, 0 failed. Ready for another review pass.@Revens2 on GitHub · 2026-11-25 09:35 UTC · original
@codex review (head rebased on origin/main; earlier findings were addressed before the rebase)
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 09:35 UTC · original
Codex Review: Something went wrong. Try again later by commenting “@codex review”.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:57 UTC · original · edited 2026-11-25 09:35 UTC
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
We couldn’t complete this review. Comment
@codex reviewto try again.4399972ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:07 UTC · original
On
crates/victory-shader/src/merged.rsline 223 (outdated):If a GS has an unresolved
s_setpc_b64whose target reaches another GS block, the IR marks the exitIndirect, but this branch treats it likeEnd.limitsthen counts only pre-jump emits, somax_verticescan be lower than the shader's actual maximum; reject such paths or resolve their targets before reporting a bound.Useful? React with 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:07 UTC · original
On
crates/victory-shader/src/io.rsline 317 (outdated):For ES/GS containers,
RootParam.sgprsis deserialized from the layout without a range check, so a malformed entry with a large count can overflowat + p.sgprs: checked builds panic, while release builds can wrap and incorrectly treat s8/s9 as free. Use checked or widened interval arithmetic here and inpair_es_gs.Useful? React with 👍 / 👎.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.