Tick-gap count read as a percentage: 68% should be 42%, and it justifies a live constant
- Dominant language
- C#
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
A tick-gap **count** was read as a **percentage** and has propagated from a research doc, through a
locked spec, into a live constant and a test comment.
## The arithmetic
`tools/combat/MECHANICS-VERIFICATION.md:169` records the histogram as counts:
> 161 exchange gaps, every one an integer multiple of 2.000s (68 x 1, 46 x 2, 35 x 3, 12 x 4, zero
> off-lattice)
`68 + 46 + 35 + 12 = 161`, matching the stated `n`. So one-tick gaps are `68/161` = **42%**, not 68%.
`tools/combat/archive/TICK-PHASE-REVIEW.md:165` reads it correctly ("42% of ticks"). Everything
downstream does not.
## Where the wrong figure now lives
| File | Text |
|---|---|
| `tools/combat/COMBAT-RAIL-SPEC.md:132` | "A one-tick gap is normal (68% of gaps)" — in a file headed **"Status: LOCKED. Implement as written."** |
| `mudsharp/Combat/ParticipantRoster.cs:66` | "One missed tick is ordinary (68% of gaps in the corpus are a single tick), so fading any sooner would have the ladder flickering" — the stated justification for `StaleAfterSeconds = 6.0` |
| `mudsharp.Tests/Fixtures/NpcHealthTrackingTests.cs:124` | "68% of miss-streaks in the corpus are exactly one" — degraded further, and pinning it against correction |
## Why it matters beyond the typo
At the true 42%, gaps of >= 3 ticks are `47/161` = **29%** — so nearly one health reading in three
trips the "stale" threshold, which is precisely the flicker the comment claims the threshold prevents.
**And it is the wrong statistic to begin with.** Those are *exchange* gaps (either side acting). The
health rung only updates on a **player landed blow**, which is a sparser distribution. So the constant
cannot be fixed by substituting 42% for 68% — it needs re-deriving from landed-blow gaps.
Note that `ParticipantRoster.cs` already uses the correct rate three lines below, for a different
constant: `UnknownAfterSeconds` is justified by `0.43^5 = 1.5%`, i.e. p=0.57 per tick. The same file
therefore carries two incompatible figures for one quantity, three lines apart.
## Scope
1. Correct the figure in all three places (safe, mechanical).
2. Re-derive `StaleAfterSeconds` from landed-blow gaps rather than exchange gaps. This is a judgement
about what the rail should show and wants deciding, not guessing.
3. `COMBAT-RAIL-SPEC.md` is marked LOCKED — amend it explicitly rather than silently.
## Provenance
Found by an adversarial audit of the `tools/combat/` corpus, 2026-08-23. Arithmetic independently
verified. This is the strongest single piece of evidence that agents reading that corpus are being
actively misled into shipping wrong constants.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the histogram in tools/combat/MECHANICS-VERIFICATION.md and compare it with tools/combat/archive/TICK-PHASE-REVIEW.md, then inspect the locked wording in tools/combat/COMBAT-RAIL-SPEC.md and the comments in ParticipantRoster.cs and NpcHealthTrackingTests.cs. Correct the copied statistic in all three places and re-derive StaleAfterSeconds from landed-blow gaps, with the amended locked spec documenting the decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100