Shaders: read the merged stage's LDS size, bound GS vertices (#311) #367
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-24T23:57:32Z.
Step 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.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:07:01Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
b622e17409ℹ️ 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".
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:57:46Z.
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.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:07:02Z.
Code review location:
crates/victory-shader/src/merged.rs; line 223If 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 👍 / 👎.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:07:02Z.
Code review location:
crates/victory-shader/src/io.rs; line 317For 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 👍 / 👎.
Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T00:18:36Z.
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.Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T07:10:10Z.
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.Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T09:35:20Z.
@codex review (head rebased on origin/main; earlier findings were addressed before the rebase)
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T09:35:39Z.
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".
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.