Skip to content

oom-seq: --oom-seq-randomize (per-sequence length + window variety)#135

Merged
devdanzin merged 1 commit into
mainfrom
oom-seq-randomize
Jun 23, 2026
Merged

oom-seq: --oom-seq-randomize (per-sequence length + window variety)#135
devdanzin merged 1 commit into
mainfrom
oom-seq-randomize

Conversation

@devdanzin

Copy link
Copy Markdown
Owner

Closes #134.

What

New --oom-seq-randomize (default off): each emitted OOM sequence independently draws its step count from [1, --oom-seq-len] and its failure window from [1, --oom-window] (the configured values become upper bounds). One instance covers a spread of sequence shapes instead of a single static config — a fixed config is just the min == max case.

How

  • oom_run() gains a window param (default _OOM_WINDOW); per-sequence windows emitted as oom_run(..., window=k). The always-printed [OOM-SEQ] marker now includes window= so a crashing sequence's window is known on replay even without --oom-verbose.
  • _oom_pick_seq_len() / _oom_pick_window() helpers; both seq generators (function + class-method) draw per sequence. Window 0 (legacy fail-forever) stays a static default, never randomized into.
  • Default off ⇒ generated output unchanged except oom_run's signature line.

Tests

TestOOMSeqGeneration gains randomize-on (per-sequence window within bounds; lengths vary within bounds) and randomize-off (no per-call window= kwarg) cases; fixture pins oom_seq_randomize=False (MagicMock auto-attrs are truthy). Full suite 326 passed / 32 skipped; ruff clean. Docs updated (CLAUDE.md + doc/oom-sequences.md, which had already proposed this).

🤖 Generated with Claude Code

`--oom-seq` previously emitted every sequence with a fixed length (--oom-seq-len)
and a single module-wide failure window (--oom-window), so covering a range of
sequence shapes meant running several fleet instances with different static
configs. New `--oom-seq-randomize` (default off) instead draws, independently for
each emitted sequence, the step count from [1, --oom-seq-len] and the failure
window from [1, --oom-window] -- the configured values become upper bounds. One
instance thus covers a spread of shapes; a fixed config is just the min==max case.

Implementation:
- oom_run() gains a `window` param (default _OOM_WINDOW) and uses it instead of
  the module constant; per-sequence windows are emitted as oom_run(..., window=k).
  The always-printed [OOM-SEQ] marker now includes window= so a crashing
  sequence's window is known on replay even without --oom-verbose.
- _oom_pick_seq_len()/_oom_pick_window() helpers; both seq generators (function
  and class-method) draw per sequence. Window 0 (legacy fail-forever) is left as a
  static default and never randomized into.
- Default off => generated output unchanged except oom_run's signature line.

Tests: TestOOMSeqGeneration gains randomize-on (per-sequence window in bounds,
lengths vary in bounds) and randomize-off (no per-call window kwarg) cases; the
fixture pins oom_seq_randomize=False (MagicMock auto-attrs are truthy). Full suite
326 passed / 32 skipped; ruff clean. Docs: CLAUDE.md + doc/oom-sequences.md
(which had already proposed this).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@devdanzin devdanzin merged commit 49c66a6 into main Jun 23, 2026
@devdanzin devdanzin deleted the oom-seq-randomize branch June 23, 2026 14:47
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.

OOM sequences: randomize sequence length and window per-sequence for more variety in one instance

1 participant