refactor: decouple world and RHI interface seams - #835
Conversation
…ce-seams # Conflicts: # src/engine/graphics/lpv_system.zig # src/engine/graphics/shadow_scene.zig # src/engine/graphics/world_render_view.zig
📋 SummaryPR #835 closes #796, #797, #798, #799, #800.
Critical blocker: 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)[CRITICAL]
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 7 | Role interfaces and backend dispatcher clarify responsibilities, but IWorldSimulation mixes save, physics, block mutation, and pause concerns. |
| Open/Closed | 6 | Dispatcher helps for backends, but monolithic RHI.VTable still requires backend edits to add sub-interfaces. |
| Liskov Substitution | 8 | Interface structs are uniform; no type-punning issues found. |
| Interface Segregation | 5 | World roles are split, but IWorldSimulation is a grab-bag and RHI vtable is not segregated. |
| Dependency Inversion | 5 | Game code now depends on abstractions, but the abstractions leak back to concrete *World and engine-rhi now depends on engine-lighting. |
| Average | 6.2 |
🎯 Final Assessment
Overall Confidence Score: 45%
Confidence Breakdown:
- Code Quality: 60% (good refactor direction, but incomplete and build-breaking)
- Completeness: 45% (two of five linked issues are only partially satisfied)
- Risk Level: 75% (main build fails; incomplete abstraction migration)
- Test Coverage: 35% (
zig build testpasses whilezig buildfails, masking the regression)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60%
- No security concerns
- Tests present and passing (if applicable)
Verdict:
DO NOT MERGE — the PR breaks the main build and does not fully satisfy the linked #796 and #797 requirements.
{
"reviewed_sha": "019415057bc8071621b02647dd3e3112be6e5693",
"critical_issues": 1,
"high_priority_issues": 2,
"medium_priority_issues": 2,
"overall_confidence_score": 45,
"recommendation": "DO NOT MERGE"
}
📋 SummaryPR #835 claims to close #796, #797, #798, #799, and #800.
The refactor is directionally correct, builds, and tests pass, but it overclaims closure on two linked issues. 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)✅ [FIXED] Previous issue: None identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 7 | Role interfaces and dispatcher clarify responsibilities, but IWorldSimulation mixes save, physics, block mutation, and pause concerns. |
| Open/Closed | 6 | Dispatcher helps for backends, but monolithic RHI.VTable still requires backend edits to add sub-interfaces. |
| Liskov Substitution | 8 | Interface structs are uniform; no type-punning issues found. |
| Interface Segregation | 5 | World roles are split, but IWorldSimulation is a grab-bag and RHI vtable is not segregated. |
| Dependency Inversion | 5 | Game code now depends on abstractions, but the abstractions leak back to concrete *World. |
| Average | 6.2 |
🎯 Final Assessment
Overall Confidence Score: 60%
Confidence Breakdown:
- Code Quality: 70% (good refactor direction, builds cleanly)
- Completeness: 55% (three of five linked issues fully satisfied; [SOLID] [M13] Migrate game-core/game-ui onto existing role interfaces (stop using concrete World) #796 and [SOLID] [M12] Allow backends to implement individual RHI sub-interfaces (drop composite bundling) #797 incomplete)
- Risk Level: 60% (incomplete abstraction migration, but main build passes)
- Test Coverage: 60% (existing tests pass; no new tests for interface contracts)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60% (at threshold, but unresolved high issues remain)
- No security concerns
- Tests present and passing
Verdict:
DO NOT MERGE — the build-breaking critical issue is fixed, but the PR still claims closure of #796 and #797 without fully satisfying their requirements.
{
"reviewed_sha": "32efbaef81a0a3fa97c441a3a839184cf2fec977",
"critical_issues": 0,
"high_priority_issues": 2,
"medium_priority_issues": 2,
"overall_confidence_score": 60,
"recommendation": "DO NOT MERGE"
}
📋 SummaryPR #835 claims to close #796, #797, #798, #799, and #800.
The refactor now builds cleanly (debug, test, and 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)✅ [FIXED] Previous issue: None identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 7 | Role interfaces and dispatcher clarify responsibilities, but IWorldSimulation still mixes save, physics, block mutation, and pause concerns. |
| Open/Closed | 6 | Dispatcher helps for backends, but monolithic RHI.VTable still requires backend edits to add sub-interfaces. |
| Liskov Substitution | 8 | Interface structs are uniform; role wrappers now delegate through IWorld rather than downcasting. |
| Interface Segregation | 5 | World roles are split, but IWorldSimulation is broad and RHI vtable is not segregated. |
| Dependency Inversion | 7 | Game code now depends on abstractions; role wrappers no longer leak back to concrete *World. |
| Average | 6.6 |
🎯 Final Assessment
Overall Confidence Score: 75%
Confidence Breakdown:
- Code Quality: 80% (clean refactor, builds in all tested modes, new mock tests)
- Completeness: 75% (four of five linked issues fully satisfied; [SOLID] [M12] Allow backends to implement individual RHI sub-interfaces (drop composite bundling) #797 partially satisfied)
- Risk Level: 50% (incomplete RHI segregation, but runtime behavior is unchanged and tests pass)
- Test Coverage: 75% (existing tests pass; new
interface_mock_tests.zigcovers contract dispatch)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60% (threshold met, but unresolved high issue remains)
- No security concerns
- Tests present and passing
Verdict:
MERGE WITH FIXES — the build-breaking critical issue and the #796 migration are resolved, but the PR still claims closure of #797 without fully satisfying its requirement.
{
"reviewed_sha": "93923a2f81ff0e8166086cb9c634f3fe7d51fac1",
"critical_issues": 0,
"high_priority_issues": 1,
"medium_priority_issues": 0,
"overall_confidence_score": 75,
"recommendation": "MERGE WITH FIXES"
}
📋 SummaryPR #835 claims to close #796, #797, #798, #799, and #800.
The refactor builds cleanly in debug, 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)✅ [FIXED] Previous issue: None identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 7 | Role interfaces and backend dispatcher clarify responsibilities, but IWorldSimulation still mixes save, physics, block mutation, and pause concerns. |
| Open/Closed | 8 | Backends can now provide individual sub-interfaces without editing a monolithic vtable. |
| Liskov Substitution | 9 | Interface structs are uniform; role wrappers delegate through IWorld rather than downcasting. |
| Interface Segregation | 7 | RHI vtable is now segregated via optional sub-interfaces; IWorldSimulation remains broad. |
| Dependency Inversion | 8 | Game code depends on abstractions; engine-rhi no longer leaks back to engine-lighting. |
| Average | 7.8 |
🎯 Final Assessment
Overall Confidence Score: 85%
Confidence Breakdown:
- Code Quality: 85% (clean refactor, builds in all tested modes)
- Completeness: 85% (four of five linked issues fully satisfied; [SOLID] [M13] Migrate game-core/game-ui onto existing role interfaces (stop using concrete World) #796 has one remaining call site)
- Risk Level: 70% (RHI vtable refactor touches core abstraction, but runtime behavior is unchanged and tests pass)
- Test Coverage: 80% (existing tests pass; new interface mock tests cover contract dispatch; no test for partial RHI backend)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60%
- No security concerns
- Tests present and passing
Verdict:
MERGE WITH FIXES — the build-breaking critical issue, RHI vtable segregation (#797), and the majority of #796 are resolved, but one direct concrete World call site remains in session.zig.
{
"reviewed_sha": "99d1aab70c2700e090c17efea6d2a9ab3a873bfd",
"critical_issues": 0,
"high_priority_issues": 0,
"medium_priority_issues": 1,
"overall_confidence_score": 85,
"recommendation": "MERGE WITH FIXES"
}
📋 SummaryPR #835 closes #796, #797, #798, #799, and #800.
The refactor builds cleanly ( 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)✅ [FIXED] Previous issue: None identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 7 | Role interfaces and dispatcher clarify responsibilities, but IWorldSimulation still mixes save, physics, block mutation, and pause concerns. |
| Open/Closed | 8 | Backends can now provide individual sub-interfaces without editing a monolithic vtable; dispatcher is open for new backends. |
| Liskov Substitution | 9 | Interface structs are uniform; role wrappers delegate through IWorld rather than downcasting. |
| Interface Segregation | 7 | RHI vtable is now segregated via optional sub-interfaces; IWorldSimulation remains broad. |
| Dependency Inversion | 8 | Game code depends on abstractions; engine-rhi no longer leaks back to engine-lighting. |
| Average | 7.8 |
🎯 Final Assessment
Overall Confidence Score: 90%
Confidence Breakdown:
- Code Quality: 90% (clean refactor, builds in all tested modes, new mock tests)
- Completeness: 95% (all five linked issues fully satisfied)
- Risk Level: 70% (RHI vtable refactor touches core abstraction, but runtime behavior is unchanged and tests pass)
- Test Coverage: 80% (existing tests pass; mock tests cover vtable dispatch; no tests for partial RHI backends)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60%
- No security concerns
- Tests present and passing
Verdict:
MERGE — the build-breaking issue, RHI vtable segregation, and role-interface migration are all resolved; only minor naming/safety polish remains.
{
"reviewed_sha": "1a6c51d1ddfc1a3ba1a310b162b96157f0e3aeb1",
"critical_issues": 0,
"high_priority_issues": 0,
"medium_priority_issues": 0,
"overall_confidence_score": 90,
"recommendation": "MERGE"
}




Summary
Verification
Closes #796
Closes #797
Closes #798
Closes #799
Closes #800