Skip to content

test: add biome selector regression coverage#664

Merged
github-actions[bot] merged 1 commit into
devfrom
test/biome-selector-regressions-648
May 2, 2026
Merged

test: add biome selector regression coverage#664
github-actions[bot] merged 1 commit into
devfrom
test/biome-selector-regressions-648

Conversation

@MichaelFisher1997
Copy link
Copy Markdown
Collaborator

Summary

  • Add baseline regression coverage for biome selector outputs across ocean, coast, frozen ocean, lowland, mountain, hot/dry, cold, wet, and transition-prone inputs.
  • Lock river and frozen river override priority plus height, slope, continentalness, ridge-mask baseline, and fallback behavior.

Verification

  • nix develop --command zig fmt modules/world-worldgen/src/biome_selector_tests.zig
  • nix develop --command zig build test

Fixes #648

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

📋 Summary

This PR fixes #648 by adding regression test coverage for the biome selector system. It introduces 5 new tests covering climate/structural baseline selections, river/frozen-river priority overrides, structural constraint edge cases, ridge mask behavior, and Voronoi fallback logic. The implementation is test-only (no production code changes) and the test file is already registered in src/tests.zig:61.

📌 Review Metadata

Overall quality is high: the tests are deterministic, pure (no allocators/GPU/window required), call real production functions, and expectations were manually verified against the BIOME_POINTS registry in biome_registry.zig.


🔴 Critical Issues (Must Fix - Blocks Merge)

None identified.

⚠️ High Priority Issues (Should Fix)

None identified.

💡 Medium Priority Issues (Nice to Fix)

None identified.

ℹ️ Low Priority Suggestions (Optional)

[LOW] modules/world-worldgen/src/biome_selector_tests.zig:393 — Ridge mask test documents unused parameter
Confidence: High
Description: The test selectBiomeWithConstraints documents ridge mask baseline behavior passes ridge_mask: 0.0 and ridge_mask: 1.0 to selectBiomeWithConstraints, but that function only forwards height, continentalness, and slope to selectBiomeVoronoiridge_mask is silently ignored. The test therefore documents that ridge_mask has no effect, rather than testing any ridge mask logic.
Impact: If ridge mask logic is added later, this test will fail and need updating. It may mislead readers into thinking ridge_mask is already wired up.
Suggested Fix: Either add a comment inside the test body explaining that ridge_mask is currently unused by selectBiomeWithConstraints, or rename the test to "selectBiomeWithConstraints ignores ridge_mask (currently unused)" to make the intent explicit.


📊 SOLID Principles Score

Principle Score Notes
Single Responsibility 9 Each test has one clear focus; the parameterized test uses a table but still verifies one concept.
Open/Closed 10 Pure test addition; no production code modified.
Liskov Substitution N/A Not applicable to test files.
Interface Segregation 9 Tests target specific functions (selectBiomeWithConstraints, selectBiomeVoronoi, etc.) without overloading.
Dependency Inversion 8 Tests call production functions directly; no mocks needed for pure logic.
Average 9.0

🎯 Final Assessment

Overall Confidence Score: 92%

Confidence Breakdown:

  • Code Quality: 95% (Clean, idiomatic Zig; follows existing conventions; good use of errdefer for debugging.)
  • Completeness: 90% (Covers the stated requirements from Worldgen Phase 0: add biome selector regression tests #648. Could be stronger with non-exact-match Voronoi distances, but exact-match regression tests are valid.)
  • Risk Level: 95% (Test-only change; zero runtime risk.)
  • Test Coverage: 90% (5 focused tests; all deterministic and pure. Minor gap: ridge_mask is not actually exercised, only documented as ignored.)

Merge Readiness:

  • All critical issues resolved
  • SOLID average score >= 6.0
  • Overall confidence >= 60%
  • No security concerns
  • Tests present and passing (if applicable)

Verdict:

MERGE

Clean test-only PR that locks biome selector baseline behavior. The one low-priority note about ridge_mask documentation is not blocking.

{
  "reviewed_sha": "00ff405c14359d5f807ac7a48443c0932ee9a2dd",
  "critical_issues": 0,
  "high_priority_issues": 0,
  "medium_priority_issues": 0,
  "overall_confidence_score": 92,
  "recommendation": "MERGE"
}

New%20session%20-%202026-05-02T20%3A50%3A02.728Z
opencode session  |  github run

@github-actions github-actions Bot enabled auto-merge (squash) May 2, 2026 20:54
@github-actions github-actions Bot merged commit e8ddd98 into dev May 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Worldgen Phase 0: add biome selector regression tests

1 participant