Skip to content

7 WorldGen determinism tests added - #79

Merged
MichaelFisher1997 merged 2 commits into
mainfrom
opencode/issue39-20251227004648
Dec 27, 2025
Merged

7 WorldGen determinism tests added#79
MichaelFisher1997 merged 2 commits into
mainfrom
opencode/issue39-20251227004648

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

I've implemented the WorldGen determinism tests as requested in the issue. Here's a summary of the tests added to src/tests.zig:

Tests Added:

  1. "WorldGen same seed produces identical blocks at origin" - Verifies two generators with the same seed produce identical block data at chunk (0,0)

  2. "WorldGen same seed produces identical biomes at origin" - Verifies two generators with the same seed produce identical biome data

  3. "WorldGen same seed produces identical blocks at different positions" - Verifies same seed produces consistent results across different chunk positions, and different positions produce different output

  4. "WorldGen different seeds produce different blocks" - Verifies different seeds produce different block output

  5. "WorldGen different seeds produce different biomes" - Verifies different seeds produce different biome output

  6. "WorldGen determinism across multiple chunks with same seed" - Tests determinism across multiple chunk positions (0,0), (5,-3), (-7,12) with multiple generator instances

  7. "WorldGen golden output for known seed at origin" - Basic regression test verifying generation produces expected characteristics (bedrock, solid surface, reasonable height)

Acceptance Criteria Met:

  • ✅ Determinism test: same seed → same output
  • ✅ Different seed test: different seeds → different output
  • ✅ Golden output test for regression detection

Closes #39

New%20session%20-%202025-12-27T00%3A46%3A47.998Z
opencode session  |  github run

Co-authored-by: MichaelFisher1997 <MichaelFisher1997@users.noreply.github.com>
@opencode-agent opencode-agent Bot mentioned this pull request Dec 27, 2025
3 tasks
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Dec 27, 2025
@MichaelFisher1997

Copy link
Copy Markdown
Collaborator

/oc can u confirm this link issue is resolved and that the tests will run it our CI too

@opencode-agent

Copy link
Copy Markdown
Contributor Author

Based on my analysis:

Tests Status: ✅ Confirmed - All 7 WorldGen determinism tests are present in src/tests.zig (lines 705-860):

  • Same seed produces identical blocks at origin
  • Same seed produces identical biomes at origin
  • Same seed produces identical blocks at different positions
  • Different seeds produce different blocks
  • Different seeds produce different biomes
  • Determinism across multiple chunks with same seed
  • Golden output for known seed at origin

CI Issue: ❌ Tests will NOT run in CI. The .github/workflows/build.yml only runs nix build -L (line 31) to build the project but does not include a test step. The workflow needs to add:

    - name: Run Tests
      run: nix develop --command zig build test

Recommendation: The link issue (#39) for adding tests is partially resolved (tests are written), but CI integration is missing. Add a test step to the build workflow to ensure tests run automatically on PRs and pushes.

New%20session%20-%202025-12-27T00%3A58%3A45.065Z
opencode session  |  github run

@MichaelFisher1997

Copy link
Copy Markdown
Collaborator

/oc can u confirm this link issue is resolved and that the tests will run it our CI too

@opencode-agent

Copy link
Copy Markdown
Contributor Author

Tests Status: ✅ Confirmed - All 7 WorldGen determinism tests are present in src/tests.zig (lines 705-860).

CI Issue: ❌ Tests will NOT run in CI. The .github/workflows/build.yml only runs nix build -L (line 31) for building - no test step exists.

Resolution: The link issue (#39) is partially resolved - tests are written, but CI integration is missing. Add this step to build.yml after the Build step:

    - name: Run Tests
      run: nix develop --command zig build test

New%20session%20-%202025-12-27T01%3A00%3A59.551Z
opencode session  |  github run

@MichaelFisher1997

Copy link
Copy Markdown
Collaborator

/oc pull main and resolve conflicts

@opencode-agent

Copy link
Copy Markdown
Contributor Author

remote: error: GH006: Protected branch update failed for refs/heads/main.
remote:
remote: - At least 1 approving review is required by reviewers with write access.
To https://github.com/MichaelFisher1997/ZigCraft
! [remote rejected] main -> main (protected branch hook declined)
error: failed to push some refs to 'https://github.com/MichaelFisher1997/ZigCraft'

opencode session  |  github run

@MichaelFisher1997
MichaelFisher1997 merged commit be23c56 into main Dec 27, 2025
4 checks passed
@MichaelFisher1997
MichaelFisher1997 deleted the opencode/issue39-20251227004648 branch February 10, 2026 23:20
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.

Add WorldGen determinism tests

1 participant