Skip to content

feat(pack): plan --fleet — prediction → placement (Act-2 opener) - #36

Merged
logannye merged 1 commit into
mainfrom
rosalind/act2-plan-fleet
Jun 2, 2026
Merged

feat(pack): plan --fleet — prediction → placement (Act-2 opener)#36
logannye merged 1 commit into
mainfrom
rosalind/act2-plan-fleet

Conversation

@logannye

@logannye logannye commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

Act 2 opener — the highest-moat feature (audit judge 43.3). The contract's prediction becomes a placement decision. Because the predicted peak is computed from the index header alone (no run, no read I/O — milliseconds), is a conservative upper bound (sound since the Act-1 soundness fix recorded predicted_peak_rss_bytes), and is additive, a scheduler can sum predicted peaks across co-located jobs and prove a node fits before launching a byte.

No emergent-peak caller (GATK, DeepVariant) can do this: their peak is only known after a possible OOM-kill, so every co-location is a gamble. Copying it requires first making peak predictable — which is the entire Rosalind thesis.

What's new

  • src/call/pack.rs — a pure, deterministic first-fit-decreasing bin-packer over predicted peaks. Packed(...) is a proof: every node's summed peak capacity. A job larger than a whole node, or a set that needs more than --nodes, is NoFit. Ties break by label → the schedule is reproducible (the contract's determinism extends to placement).
  • rosalind pack --jobs <tsv> --node-mb N [--nodes M] — read each job's index header → predicted peak → pack onto nodes, or refuse (exit 3) with an actionable message. Human-readable or --json.
  • rosalind plan --index --json — the predicted-peak breakdown as one line of JSON for a workflow engine to read programmatically.
$ rosalind pack --jobs jobs.tsv --node-mb 64
pack: 3 job(s) → 1 node(s) of 64 MiB — every node proven within capacity
  node 0: 48 / 64 MiB  [a.idx, a.idx, b.idx]

$ rosalind pack --jobs one-big.tsv --node-mb 16        # job > node
pack: REFUSE — job 'big.idx' predicted peak 19229088 B exceeds the node capacity 16777216 B …   # exit 3

Test plan

  • 5 packer unit tests — incl. the proof property (every node capacity), determinism (order-independent), job-bigger-than-node refusal, --nodes cap
  • tests/pack.rs integration — fit (proof line) / refuse (exit 3) / --json
  • plan --index --json emits the machine-readable prediction
  • Full suite green (31 sections); rustc 0 warnings; additions clippy-clean; smoke-tested end-to-end on real indexes

Why this, now

It's the single highest-leverage compounding move: it makes the contract a fleet property, and it's only sound because Act-1 PR-A made the predicted peak a true upper bound. Next Act-2 candidates (from the audit): ColumnKit SDK (46.3), bounded gVCF (42.7), verify-attest signed receipts (43).

🤖 Generated with Claude Code

…ecision

The predicted peak is computed from the index header alone (no run, no read
I/O), is a conservative upper bound (sound since the Act-1 soundness fix), and
is additive — so a scheduler can SUM predicted peaks across co-located jobs and
PROVE a node fits before launching a byte. No emergent-peak caller (GATK,
DeepVariant) can: their peak is only known after a possible OOM-kill, so every
co-location is a gamble.

- src/call/pack.rs: a pure, deterministic first-fit-decreasing bin-packer over
  predicted peaks. `Packed` is a proof — every node's summed peak <= capacity;
  a job larger than a node, or a set that needs more than --nodes, is NoFit.
- `rosalind pack --jobs <tsv> --node-mb N [--nodes M]`: read each job's index
  header → predicted peak → pack onto nodes, or refuse (exit 3). Human or --json.
- `rosalind plan --index --json`: the predicted-peak breakdown as one-line JSON
  for a workflow engine to read.
- README "Pack a fleet: prediction → placement" + roadmap.

Tests: 5 packer unit tests (incl. the proof property + determinism) + a pack
integration test (fit / refuse exit 3 / json) + plan --json. Full suite green;
rustc 0 warnings; additions clippy-clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@logannye
logannye merged commit 7a60446 into main Jun 2, 2026
3 checks passed
@logannye
logannye deleted the rosalind/act2-plan-fleet branch June 2, 2026 21:36
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.

1 participant