Skip to content

Trim oversized structural-impossibility test loops#726

Draft
stphung wants to merge 1 commit into
mainfrom
claude/lucid-brahmagupta-czzjjl
Draft

Trim oversized structural-impossibility test loops#726
stphung wants to merge 1 commit into
mainfrom
claude/lucid-brahmagupta-czzjjl

Conversation

@stphung

@stphung stphung commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Ran the test-audit skill (3 parallel Explore agents across core/combat, systems, and items/achievements/misc test scopes)
  • Found several tests looping 200–1000x to check invariants that hold by construction (guard conditions, structural range/membership bounds) rather than probabilistically — capped these at the project's documented 100-iteration norm for structural-impossibility checks
  • Removed a stale comment in tick_integration_test.rs claiming spawn_enemy_if_needed/apply_tick_xp use thread_rng() internally; verified against source that both are already fully deterministic
  • Other findings (duplicate test names, helper-function duplication across files, redundant coverage between files, a 20k-iteration full-combat-sim loop) were flagged as needing human judgment rather than auto-fixed, per the audit skill's policy — not included in this PR
  • ~40-occurrence known brute-force-RNG-search-loop debt (tracked since 2026-07-02) intentionally left untouched, per skill guidance

Test plan

  • cargo test --test game_tick_tests --test stormglass_tests --test fishing_tests --test deep_tests — all green
  • make check (fmt, clippy, full test suite, progression check, security audit) — all green
  • cargo test run 10x consecutively — 0 failures across all runs

Generated by Claude Code

test-audit found several tests looping 200-1000x to check invariants
that hold by construction (guard conditions, range bounds) rather than
probabilistically. Capped these at the project's 100-iteration norm and
removed a stale comment claiming thread_rng() usage in subsystems that
are now deterministic.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MCvTyg5vGLvxjHwv2tfJkc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants