audit-arithmetic
ben-manes/caffeine/.claude/skills/audit-arithmetic/SKILL.md
Audit for arithmetic and boundary bugs (overflow, off-by-one, drift)
Skill18k starsChanged 18 days ago
--- name: audit-arithmetic description: Audit for arithmetic and boundary bugs (overflow, off-by-one, drift) context: fork agent: auditor disable-model-invocation: true --- Assume there is at least one arithmetic or boundary bug in this code. Audit for: - Off-by-one errors - Incorrect inequality direction (< vs <=, > vs >=) - Overflow / underflow (int, long, specifically nanoTime arithmetic) - Implicit narrowing or widening conversion - Incorrect rounding or truncation - Sign errors - Sentinel value collisions (can a valid value equal a sentinel?) - Counter drift (can a counter diverge from the quantity it tracks over a long-running cache?) - Timer wheel bucket arithmetic (modular arithmetic, wrap-around) - Frequency sketch counter saturation and reset arithmetic - Hill climber / adaptive sizing: window vs main partition adjustment; the density and probe-verdict log-ratios (`ln((x+ε)/(y+ε))`), the probation-capacity denominator (`max(1, maximum − windowMaximum − mainProtectedMaximum)`), the saturated `4·maximum` sample period, and the stride/commitment rung tables (percentage calculations, rounding, overshoot, oscillation) - FrequencySketch table size calculation (ensureCapacity rounding to power of two, interaction with maximumSize) - Weight delta computation in UpdateTask (sign conventions, can intermediate sums overflow when weights are near Integer.MAX_VALUE?) For each suspected issue: - Provide a concrete input (specific key, value, weight, time values) - Show step-by-step evaluation through the code - Show expected vs actual behavior - If it requires billions of operations, state the count needed Ignore style and performance. Only report high-confidence defects supported by evaluation traces.
More agent context in ben-manes/caffeine
36 other files this repository gives its agents.
AGENTS.md
CLAUDE.md
Copilot instructions
Skill
- audit-adaptivity.claude/skills/audit-adaptivity/SKILL.md
- audit-adversarial-input.claude/skills/audit-adversarial-input/SKILL.md
- audit-adversarial.claude/skills/audit-adversarial/SKILL.md
- audit-build-ci.claude/skills/audit-build-ci/SKILL.md
- audit-contract-drift.claude/skills/audit-contract-drift/SKILL.md
- audit-correctness-proof.claude/skills/audit-correctness-proof/SKILL.md
- audit-coverage-gaps.claude/skills/audit-coverage-gaps/SKILL.md
- audit-exception-safety.claude/skills/audit-exception-safety/SKILL.md
- audit-feature-interaction.claude/skills/audit-feature-interaction/SKILL.md
- audit-iteration.claude/skills/audit-iteration/SKILL.md
- audit-jcache-conformance.claude/skills/audit-jcache-conformance/SKILL.md
- audit-jmm.claude/skills/audit-jmm/SKILL.md
- audit-lifecycle.claude/skills/audit-lifecycle/SKILL.md
- audit-linearizability.claude/skills/audit-linearizability/SKILL.md
- audit-liveness.claude/skills/audit-liveness/SKILL.md
- audit-map-contract.claude/skills/audit-map-contract/SKILL.md
- audit-memory-retention.claude/skills/audit-memory-retention/SKILL.md
- audit-performance.claude/skills/audit-performance/SKILL.md
- audit-redundancy.claude/skills/audit-redundancy/SKILL.md
- audit-reentrancy.claude/skills/audit-reentrancy/SKILL.md
- audit-regret.claude/skills/audit-regret/SKILL.md
- audit-serialization.claude/skills/audit-serialization/SKILL.md
- audit-sibling-divergence.claude/skills/audit-sibling-divergence/SKILL.md
- audit-state-machine.claude/skills/audit-state-machine/SKILL.md
- audit-subsystem-safety.claude/skills/audit-subsystem-safety/SKILL.md
- audit-temporal-walk.claude/skills/audit-temporal-walk/SKILL.md
- audit-third-party-contracts.claude/skills/audit-third-party-contracts/SKILL.md
- climber-gate.claude/skills/climber-gate/SKILL.md
- climber-minimize.claude/skills/climber-minimize/SKILL.md
- optimize-cache.claude/skills/optimize-cache/SKILL.md
- review-change.claude/skills/review-change/SKILL.md
- sim-analyze.claude/skills/sim-analyze/SKILL.md
- sim-compare.claude/skills/sim-compare/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

