UFC 5 in-game #883
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!883
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/883/head"
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?
@Nmzik on GitHub · 2026-09-28 02:41 UTC · original
KytyPS5:ufc-5-in-game→main· +3226 −2265 · 34 files · 18 commits · merged 2026-09-28 12:03 UTCHuge change, requires extensive testing against main branch
The generated shaders seem to be smaller than before
@coderabbitai[bot] on GitHub · 2026-09-28 02:49 UTC · original · edited 2026-09-28 03:01 UTC
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
📝 Walkthrough
Walkthrough
The changes update sampler type specialization and border-color caching, color-output selection for draws, shader CFG structurization, descriptor and scalar-read tracking, FP32 denormal handling, and scalar-address and append/consume memory operations. The test suites add coverage for these paths and rename PM4-related test references.
Priority: ⬇️ Low
Change: Feature
Merge Risk: 🟡 Moderate · up to
4dd35Several shader-compilation changes can cause incorrect rendering or compute results. Branches can go the wrong way in partially filled waves. Some loops can exit at the wrong point. Shaders with many samplers can be rejected. Pixel-shader buffer writes can be dropped. Address these issues before merging.
Security Architecture Review
Security architecture risk: 🟡 Moderate · up to
4dd35Resource binding and memory-access behavior change across the shader compiler and renderer. No security regression was confirmed, but the changed access paths warrant design-level validation.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❓ 1
❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 4.24% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 165 functions across 29 files. (3 skipped: 1 unsupported, 2 too large.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@ -885,0 +889,4 @@const auto color_output_mask = DrawColorOutputMask(buffer.GetRegisters());state.ps_active = buffer.GetShaders().GetPs().ps_regs.data_addr != 0 &&(color_output_mask != 0 ||PixelShaderHasDepthOrCoverageSideEffects(shader_regs));@coderabbitai[bot] on GitHub · 2026-09-28 02:49 UTC · original
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Keep pixel shaders with buffer writes active.
If a pixel shader writes to a buffer but has no active color output or depth/coverage flag, this condition sets
state.ps_activeto false.ExecutePreparedDrawthen omits the pixel-shader bindings and its buffer-write path, so the draw loses those writes. Include pixel-shader buffer writes in the activity decision.@ -639,0 +655,4 @@TypeU32(ctx.state), combined, low, high);ctx.state.builder.AddFunction(zero ? spv::OpIEqual : spv::OpINotEqual,TypeBool(ctx.state), result, combined,ConstantU32(ctx.state, zero ? ~0u : 0u));@coderabbitai[bot] on GitHub · 2026-09-28 02:49 UTC · original
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 21343
Ignore inactive lanes in zero-condition reduction.
For zero conditions, ballot the positive predicate (
x), reduce the ballot words withOpBitwiseOr, and compare the result with0u.OpGroupNonUniformBallotleaves inactive invocation bits clear, so the currentOpBitwiseAnd/~0ureduction can rejectExecZero,VccZero, orSccZerowhen a partial wave is present. This can select the nonzero branch incorrectly.@ -1882,0 +1216,4 @@if (std::ranges::any_of(loop->children, [](auto* child) { return child->kind == Kind::Break; })) {Fail("goto lifting would capture an enclosing loop exit");return node;}@coderabbitai[bot] on GitHub · 2026-09-28 02:49 UTC · original
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Check for
Breaknodes at every depth before lifting a goto into a newLoop.The guard at Line 1300 checks only the direct children of the new
Loop.Breaknodes can also sit inside nestedIfnodes:Eliminate(Lines 1331-1335) moves siblings, includingBreaknodes, into a selectionIf.Inward(Lines 1273-1277) moves siblings into a restIf.Visitpassesbreak_blockthroughIfnodes (Line 1454). If a spliced range contains anIfwith a nestedBreak, thatBreaknow targets the merge of the new liftedLoop, not the merge of the enclosing loop. The shader then keeps running the enclosing loop where the guest code exits it. The finalRecomputeAnalyses/irreducibility check does not catch this, because the result is still a reducible CFG.Search the spliced subtree recursively. Stop at nested
Loopnodes, because theirBreaknodes target their own merge.🐛 Proposed fix
@ -633,0 +629,4 @@for (uint32_t type = 0; type < mapping.size(); type++) {if ((classes & (1u << type)) == 0u) continue;const auto target = first ? index : plan.sampler_count++;if (target >= ShaderInfo::MaxSamplers) return false;@coderabbitai[bot] on GitHub · 2026-09-28 02:49 UTC · original
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Avoid rejecting valid shaders when sampler classes exceed the binding limit.
If a shader uses 32 distinct samplers and one sampler serves both a float and an unsigned image, this split requests 33 bindings.
BuildSamplerPlanthen fails, so resource materialization rejects the shader. Resource tracking permits 32 distinct samplers and records these image–sampler pairs. Avoid allocating a separate typed-border binding when the sampler does not use border clamping, or provide another layout that preserves this valid case. (raw.githubusercontent.com)@ -637,0 +677,4 @@}}}ir.value_storage.clear();@coderabbitai[bot] on GitHub · 2026-09-28 02:49 UTC · original
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 18257
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 21802
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 5840
Clear
srt_readswhen clearingvalue_storage.PlanScalarReadsmoves each retained read intovalue_storageand storesValue(read)insrt_reads.CompileProgramthen destroysvalue_storagebut leaves those references in the returnedCompileResult.program. A caller that passes this program toExtractResourcePlancan dereference destroyed instructions.The current pipeline extracts the resource plan before compilation and later calls
TakeCompiledInfo, but the returnedProgramstill contains dangling references.Suggested fix
📝 Committable suggestion
@coderabbitai[bot] on GitHub · 2026-09-28 02:49 UTC · original · reviewed
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
4d6868db-fe38-4b48-9318-fac7298cb2d4📥 Commits
Reviewing files that changed from the base of the PR and between
421684e75fand4dd35a42b3.📒 Files selected for processing (33)
src/graphics/host_gpu/renderer/cache/samplerCache.cppsrc/graphics/host_gpu/renderer/cache/samplerCache.hsrc/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/host_gpu/renderer/renderDraw.cppsrc/graphics/shader/recompiler/ShaderRecompiler.cppsrc/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterInstructions.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cppsrc/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cppsrc/graphics/shader/recompiler/frontend/cfg/ShaderCFG.hsrc/graphics/shader/recompiler/frontend/translate/Compare.cppsrc/graphics/shader/recompiler/frontend/translate/Memory.cppsrc/graphics/shader/recompiler/frontend/translate/Translate.cppsrc/graphics/shader/recompiler/frontend/translate/Translator.hsrc/graphics/shader/recompiler/ir/Program.cppsrc/graphics/shader/recompiler/ir/ShaderIR.hsrc/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.hsrc/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.incsrc/graphics/shader/recompiler/ir/passes/BindingLayout.cppsrc/graphics/shader/recompiler/ir/passes/BindingLayout.hsrc/graphics/shader/recompiler/ir/passes/ConstantPropagation.cppsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppsrc/graphics/shader/recompiler/ir/passes/ResourceTracking.cppsrc/graphics/shader/recompiler/ir/passes/ResourceTracking.hsrc/graphics/shader/recompiler/ir/passes/SrtWalker.cppsrc/graphics/shader/recompiler/ir/passes/SrtWalker.htests/ResourceTrackingTests.cpptests/ScalarProvenanceTests.cpptests/ShaderRecompilerComputeTests.cpptests/shaderCfgTests.cpp💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@cergo666 on GitHub · 2026-10-08 15:22 UTC · original
It’s a shame I’m not a programmer, as this is purely the work of AI.
I hope more experienced specialists show up here and do a proper job of it.
@hugosmoreira on GitHub · 2026-10-11 20:04 UTC · original
Hi @Nmzik — could you confirm the setup behind the successful UFC 5 (PPSA03541) gameplay test shown in this PR? I'm checking compatibility before purchasing a console and game.
contentVersion) did you use?requiredSystemSoftwareVersiondoes that game'ssce_sys/param.jsonreport, if available?Thanks — this would help distinguish the successful setup from the other reports testing version 01.031.000.