Skip to content

fix(player): detonate mines on a held crossing or a press within PGREAT (LR2) - #179

Merged
nulltask merged 1 commit into
develfrom
fix/mine-pgreat-window
Aug 19, 2026
Merged

fix(player): detonate mines on a held crossing or a press within PGREAT (LR2)#179
nulltask merged 1 commit into
develfrom
fix/mine-pgreat-window

Conversation

@nulltask

Copy link
Copy Markdown
Owner

Closes #141.

LR2's own changelog (history.txt, the 080114 mine-implementation entry) defines two detonation conditions: passing a mine with the key held ("キー押したまま地雷通過"), or pressing within the PGREAT range ("ピカグレ範囲内でキーを押すと爆発します"). No later entry revises it. The implementation followed losak's secondary writeup instead and used the GOOD window (±40–120 ms depending on rank) for both legs; the primary source wins.

Changes

  • Press leg: processLandminePassage now reads the PGREAT window (±8–21 ms) instead of GOOD. goodWindowReachUs is renamed to pgreatWindowReachUs (reads judges[0]; PGREAT sits at index 0 in every ruleset's window set).
  • Hold-through leg: anchored to the crossing itself rather than window sampling. PGREAT can be narrower than a frame tick (~16.7 ms), so a held mine could otherwise enter and leave the window between two ticks and be silently retired without detonating. When the window closes behind a mine, it now detonates if the lane was held at the moment of crossing — a kitty key still down counts, as does a non-kitty press within the 120 ms hold-grace window before the crossing. A press landing after the crossing never detonates there: that is the press leg, and it already missed PGREAT.
  • Tests: retitled/retuned the negative press test (±18 ms PGREAT at NORMAL rank), added "press inside GOOD but outside PGREAT does not detonate" and a deterministic positive tap test that exercises the crossing leg without depending on tick cadence. The beatoraja SEVENKEYS PGREAT reach assertion ([20_000, 20_000]) replaces the old GOOD one.
  • Docs: the mine sections in docs/player-spec.md / .ja.md and docs/bms-spec.md / .ja.md now state the two-condition model and record why losak's GOOD claim is not adopted (primary source conflict, resolved in favor of LR2's changelog).

Notes

  • The playlog simulator's mine model (detonate-at-crossing-while-held) was already window-agnostic and needed no change; the residual engine/simulator divergence on the press leg shrinks from ±40–120 ms to ±8–21 ms.

Testing

  • vitest run packages/player/src/ruleset/judge.test.ts packages/player/src/index.test.ts — 97 passed.
  • The mine test subset ran 5× consecutively with no flakes (guards the tick-cadence concern).
  • tsc typecheck and oxlint clean for @be-music/player.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
be-music-player-demo f24ed8b Commit Preview URL

Branch Preview URL
Aug 19 2026, 11:07 AM

@github-actions

Copy link
Copy Markdown

Exports Benchmark

  • Base SHA: 6c325bc55fa9
  • Head SHA: f24ed8b8b5a7
  • Comparable cases: 242
  • Regression threshold: 8.00%
  • Base runs: median of 3
  • Head runs: median of 3

Summary

Metric Value
Improved (>= threshold) 1
Regressed (<= -threshold) 1
Unchanged 240
Median change +0.23%
Mean change +0.19%
Head benchmarked cases 242
Head skipped cases 21

Top Regressions

API Base ops/s Head ops/s Change
stringifier.stringifyBms 21398.34 18417.29 -13.93%

Top Improvements

API Base ops/s Head ops/s Change
audio-renderer.writeAudioFile 4806.40 5223.48 +8.68%

@nulltask
nulltask merged commit 817a66c into devel Aug 19, 2026
13 checks passed
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.

Mine press-detonation window should be the PGREAT range, not GOOD (LR2)

1 participant