Fix or quarantine Warbow benchmark forge tests #353

Closed
opened 2026-06-25 20:07:33 +00:00 by PlasticDigits · 4 comments
PlasticDigits commented 2026-06-25 20:07:33 +00:00 (Migrated from gitlab.com)

Parent

Transition Gap Analysis (#342) — P2 #13. Bundles M-C5.

Current codebase

  • TimeArenaWarbowBenchmark.t.sol: test_benchmark_warbow_10k_player_ranking (timer not armed), test_benchmark_warbow_steal_10k_player_ranking (level) failed in gap-analysis CI run.
  • Gas benchmarks, not correctness — but failures obscure forge test signal (215 pass / 6 fail with 4 expected fork airdrop misses).

Why needed

Clean forge test signal is required for agent/CI verification; benchmark flakes block transition-gap follow-up work.

Constraints / guardrails

  • Prefer fixing setup (arm timer, set level) over deleting benchmarks.
  • If inherently flaky, quarantine with FOUNDRY_PROFILE or explicit vm.skip + issue link — document in ci.md.
  • Do not weaken production code for benchmark convenience.

Relevant files

  • contracts/test/TimeArenaWarbowBenchmark.t.sol
  • docs/testing/ci.md
  1. Diagnose root cause: timer not armed before roll; player level gate for steal benchmark.
  2. Fix setUp to arm WarBow timer and satisfy level gates (mirror working tests in TimeArena.t.sol).
  3. Alternatively move to separate profile run in CI if too slow.
  4. Confirm forge test passes except known doub.csv fork tests.

Acceptance criteria

  • Both benchmark tests PASS or are explicitly quarantined with documented reason.
  • Default forge test in CI/agent docs no longer reports unexpected Warbow benchmark failures.
  • No change to WarBow production ranking logic (#312).

Test plan

Path Command
Benchmark cd contracts && forge test --match-contract TimeArenaWarbowBenchmark
Full cd contracts && forge test

Attack / abuse test plan

N/A — test infrastructure only.

Verification criteria

  • forge test --match-contract TimeArenaWarbowBenchmark exits 0.
  • Gap-analysis verification table can mark contracts row green aside from optional fork tests.
## Parent [Transition Gap Analysis (#342)](https://gitlab.com/PlasticDigits/yieldomega/-/issues/342) — P2 #13. Bundles **M-C5**. ## Current codebase - `TimeArenaWarbowBenchmark.t.sol`: `test_benchmark_warbow_10k_player_ranking` (`timer not armed`), `test_benchmark_warbow_steal_10k_player_ranking` (`level`) failed in gap-analysis CI run. - Gas benchmarks, not correctness — but failures obscure `forge test` signal (215 pass / 6 fail with 4 expected fork airdrop misses). ## Why needed Clean `forge test` signal is required for agent/CI verification; benchmark flakes block transition-gap follow-up work. ## Constraints / guardrails - Prefer fixing setup (arm timer, set level) over deleting benchmarks. - If inherently flaky, quarantine with `FOUNDRY_PROFILE` or explicit `vm.skip` + issue link — document in `ci.md`. - Do not weaken production code for benchmark convenience. ## Relevant files - `contracts/test/TimeArenaWarbowBenchmark.t.sol` - `docs/testing/ci.md` ## Recommended direction 1. Diagnose root cause: timer not armed before roll; player level gate for steal benchmark. 2. Fix setUp to arm WarBow timer and satisfy level gates (mirror working tests in `TimeArena.t.sol`). 3. Alternatively move to separate profile run in CI if too slow. 4. Confirm `forge test` passes except known `doub.csv` fork tests. ## Acceptance criteria - [ ] Both benchmark tests PASS or are explicitly quarantined with documented reason. - [ ] Default `forge test` in CI/agent docs no longer reports unexpected Warbow benchmark failures. - [ ] No change to WarBow production ranking logic ([#312](https://gitlab.com/PlasticDigits/yieldomega/-/issues/312)). ## Test plan | Path | Command | |------|---------| | Benchmark | `cd contracts && forge test --match-contract TimeArenaWarbowBenchmark` | | Full | `cd contracts && forge test` | ## Attack / abuse test plan N/A — test infrastructure only. ## Verification criteria - `forge test --match-contract TimeArenaWarbowBenchmark` exits 0. - Gap-analysis verification table can mark contracts row green aside from optional fork tests.
PlasticDigits commented 2026-06-25 20:07:51 +00:00 (Migrated from gitlab.com)

mentioned in issue #342

mentioned in issue #342
PlasticDigits commented 2026-06-26 03:50:38 +00:00 (Migrated from gitlab.com)

mentioned in merge request !524

mentioned in merge request !524
PlasticDigits commented 2026-06-26 04:29:10 +00:00 (Migrated from gitlab.com)

mentioned in commit 078c379d56

mentioned in commit 078c379d56073efe9b9814eba6b79d248141f347
PlasticDigits commented 2026-06-26 08:11:44 +00:00 (Migrated from gitlab.com)

Verification — issue #353 (PASS)

Verified on main @ 078c379d (merge of issue-353-warbow-benchmark-slots).

Acceptance criteria

Criterion Result How verified
Both benchmark tests PASS or explicitly quarantined PASS cd contracts && forge test --match-contract TimeArenaWarbowBenchmark → exit 0; 2/2 passed (test_benchmark_warbow_10k_player_ranking, test_benchmark_warbow_steal_10k_player_ranking)
Default forge test no longer reports unexpected Warbow benchmark failures PASS cd contracts && forge test → 227 passed; Warbow benchmarks included in suite; only 4 failures are expected DoubAirdropMegaethFork tests missing gitignored airdrop/doub.csv
No change to WarBow production ranking logic (#312) PASS Fix is test-only: TimeArenaWarbowBenchmark.t.sol storage slot constants (SLOT_CACHED_LEVEL 106, etc.) updated after layout drift; TimeArena.sol ranking logic unchanged

Root cause (already fixed on main)

Benchmark setup used stale vm.store slots after TimeArena append-only layout drift — timer roll failed with timer not armed; steal benchmark failed level gate. Fix (df74d3fa): refresh slots from forge inspect TimeArena storage-layout, arm WarBow podium via level-4 buy() on top-3 players (mirrors TimeArena.t.sol patterns). No quarantine needed.

Docs / invariants

  • docs/testing/ci.md — WarBow benchmarks documented as included in full suite (#353)
  • docs/testing/warbow-ranking-benchmark-312.md — slot refresh note links #353
  • INV-TIME-ARENA-WARBOW-RANK-312 references TimeArenaWarbowBenchmark gas probes

No additional repo changes required from this verification pass.

## Verification — issue #353 (PASS) Verified on `main` @ `078c379d` (merge of `issue-353-warbow-benchmark-slots`). ### Acceptance criteria | Criterion | Result | How verified | |-----------|--------|--------------| | Both benchmark tests PASS or explicitly quarantined | **PASS** | `cd contracts && forge test --match-contract TimeArenaWarbowBenchmark` → exit 0; 2/2 passed (`test_benchmark_warbow_10k_player_ranking`, `test_benchmark_warbow_steal_10k_player_ranking`) | | Default `forge test` no longer reports unexpected Warbow benchmark failures | **PASS** | `cd contracts && forge test` → 227 passed; Warbow benchmarks included in suite; only 4 failures are expected `DoubAirdropMegaethFork` tests missing gitignored `airdrop/doub.csv` | | No change to WarBow production ranking logic (#312) | **PASS** | Fix is test-only: `TimeArenaWarbowBenchmark.t.sol` storage slot constants (`SLOT_CACHED_LEVEL` 106, etc.) updated after layout drift; `TimeArena.sol` ranking logic unchanged | ### Root cause (already fixed on main) Benchmark setup used stale `vm.store` slots after `TimeArena` append-only layout drift — timer roll failed with `timer not armed`; steal benchmark failed `level` gate. Fix (`df74d3fa`): refresh slots from `forge inspect TimeArena storage-layout`, arm WarBow podium via level-4 `buy()` on top-3 players (mirrors `TimeArena.t.sol` patterns). No quarantine needed. ### Docs / invariants - `docs/testing/ci.md` — WarBow benchmarks documented as included in full suite (#353) - `docs/testing/warbow-ranking-benchmark-312.md` — slot refresh note links #353 - `INV-TIME-ARENA-WARBOW-RANK-312` references `TimeArenaWarbowBenchmark` gas probes No additional repo changes required from this verification pass.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-26 08:11:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#353
No description provided.