fix: preserve biome priority boundaries#672
Conversation
📋 SummaryLinked Issue: Fixes #656 — Verified. The PR implements exactly what #656 requires:
Overall: Clean, focused bugfix PR with good test coverage. All tests pass and code is properly formatted. 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)None identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 7 | Ocean boundary logic is cleanly isolated in isOceanStructure/isOceanBiome, though selectBiomeMultiParam now mixes selection scoring with structural filtering. |
| Open/Closed | 6 | The fix modifies selectBiomeMultiParam directly rather than injecting a filter; ocean constraints are hardcoded rather than configurable. |
| Liskov Substitution | 8 | No inheritance hierarchy; all selection functions operate on value types. |
| Interface Segregation | 7 | Many public functions, but they serve distinct use cases (Voronoi, blended, constrained, LOD). |
| Dependency Inversion | 6 | Hardcoded constants depend on implicit knowledge of computeClimateParams normalization. |
| Average | 6.8 |
🎯 Final Assessment
Overall Confidence Score: 85%
- Code Quality: 85% (Clean, well-formatted, idiomatic Zig with good use of
continuefor filtering) - Completeness: 90% (Fully addresses Worldgen Phase 2: preserve ocean, coast, and river priority rules #656 for the primary generation path; LOD path unchanged by design)
- Risk Level: 20% (Low risk — pure logic change, no GPU/resource changes, no threading)
- Test Coverage: 85% (Three new boundary tests cover the exact bug; legacy paths untested)
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 PR is safe to merge as-is, but consider documenting or deduplicating the NORMALIZED_SEA_LEVEL constant relationship with computeClimateParams to prevent future maintenance bugs.
{
"reviewed_sha": "1716b575d8b99886a895ca356e226d85073ab886",
"critical_issues": 0,
"high_priority_issues": 0,
"medium_priority_issues": 2,
"overall_confidence_score": 85,
"recommendation": "MERGE"
}
📋 SummaryLinked Issue: Fixes #656 — Verified. The PR fully addresses #656 by:
The PR is a clean, focused bugfix with good test coverage. All tests pass and code is properly formatted. 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)None identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 8 | Ocean boundary logic is cleanly isolated in isOceanStructure/isOceanBiome, and selectBiomeMultiParam delegates filtering to these helpers. |
| Open/Closed | 7 | Ocean constraints are now centralized via exported constants rather than hardcoded in multiple places. |
| Liskov Substitution | 8 | No inheritance hierarchy; all selection functions operate on value types. |
| Interface Segregation | 7 | Many public functions serve distinct use cases (Voronoi, blended, constrained, LOD). |
| Dependency Inversion | 7 | NORMALIZED_SEA_LEVEL is now explicitly exported from the registry, removing implicit coupling. |
| Average | 7.4 |
🎯 Final Assessment
Overall Confidence Score: 90%
- Code Quality: 90% (Clean, well-formatted, idiomatic Zig with good helper function decomposition)
- Completeness: 95% (Fully addresses Worldgen Phase 2: preserve ocean, coast, and river priority rules #656 for primary and LOD paths; legacy paths intentionally unchanged)
- Risk Level: 10% (Low risk — pure logic change, no GPU/resource changes, no threading)
- Test Coverage: 90% (Four new boundary tests cover the exact bug; all tests pass)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60%
- No security concerns
- Tests present and passing
Verdict:
MERGE
The PR is safe to merge. Both previously reported medium-priority issues have been resolved: the NORMALIZED_SEA_LEVEL constant is now properly exported and deduplicated, and selectBiomeSimple now correctly applies elevation-aware ocean gating. The remaining low-priority item about legacy functions is optional and does not block merge.
{
"reviewed_sha": "9026c9d63e4ea1d4f52e3254f364ca9aa72dd01a",
"critical_issues": 0,
"high_priority_issues": 0,
"medium_priority_issues": 0,
"overall_confidence_score": 90,
"recommendation": "MERGE"
}
📋 SummaryLinked Issue: Fixes #656 — Verified. The PR fully implements the requirements:
The PR is a clean, focused bugfix with good test coverage. 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)None identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 8 | Ocean boundary logic cleanly isolated in isOceanStructure/isOceanClimate/isOceanBiome helpers; selectBiomeMultiParam delegates filtering without mixing concerns. |
| Open/Closed | 7 | Ocean constraints centralized via exported NORMALIZED_SEA_LEVEL and OCEAN_CONTINENTALNESS_MAX constants rather than hardcoded in multiple places. |
| Liskov Substitution | 8 | No inheritance hierarchy; all selection functions operate on value types. |
| Interface Segregation | 7 | Many public functions serve distinct use cases (Voronoi, blended, constrained, LOD), each with appropriate parameter sets. |
| Dependency Inversion | 7 | NORMALIZED_SEA_LEVEL is explicitly exported from the registry, removing implicit coupling with computeClimateParams. |
| Average | 7.4 |
🎯 Final Assessment
Overall Confidence Score: 92%
- Code Quality: 90% (Clean, well-formatted, idiomatic Zig with good helper decomposition and
continuefiltering pattern) - Completeness: 95% (Fully addresses Worldgen Phase 2: preserve ocean, coast, and river priority rules #656 for all primary, LOD, and blended selection paths)
- Risk Level: 5% (Very low risk — pure logic change in biome selection, no GPU/resource changes, no threading)
- Test Coverage: 90% (Four new boundary tests cover the exact bug; existing baseline tests remain intact)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60%
- No security concerns
- Tests present and passing (verified by prior CI runs)
Verdict:
MERGE
The PR is safe to merge. All previously reported issues have been resolved: the NORMALIZED_SEA_LEVEL constant is properly exported and deduplicated, selectBiomeSimple correctly applies elevation-aware ocean gating, and all climate-based selection functions are now protected. The implementation fully satisfies issue #656.
{
"reviewed_sha": "c4ee93b7e9f491542e8b7044710158215788a903",
"critical_issues": 0,
"high_priority_issues": 0,
"medium_priority_issues": 0,
"overall_confidence_score": 92,
"recommendation": "MERGE"
}


Summary
Verification
nix develop --command zig fmt modules/world-worldgen/src/biome_selector.zig modules/world-worldgen/src/biome_registry.zig modules/world-worldgen/src/biome_selector_tests.zignix develop --command zig build testFixes #656