Skip to content

#110: runSuite shard option — census-index striping + suite-order index on emit - #113

Merged
lann merged 1 commit into
mainfrom
ct-runner-shard-110
Aug 11, 2026
Merged

#110: runSuite shard option — census-index striping + suite-order index on emit#113
lann merged 1 commit into
mainfrom
ct-runner-shard-110

Conversation

@lann

@lann lann commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

What

Closes #110. shard?: { index: number; count: number } on RunSuiteOptions, mirroring runCases' established striping semantics, so a consumer worker pool can cut the serial case loop's CI tail (polymorph-webcrypto's 267s leg → the issue's ~90–120s at 4 workers).

  • Striping: case membership is decided on the census index i (the full enumerated list), i % count === index; a case outside the stripe is neither executed nor emitted. Membership is decided BEFORE only/tag filtering — the interpretation that keeps the invariant union of every shard's rows, in suite order, == the unsharded run's rows (pinned by the partition-identity test).
  • Suite-order index on emit: the callback gains an optional second argument caseIndex (the same i) on per-case rows — undefined for envelope/terminator — so the parent merges stripes back into suite order. The L4 row schema is untouched (goldens byte-identical); single-argument emit callers are unaffected.
  • Sharded envelope/terminator contract (documented on the option): each sharded call still emits its own envelope + terminator — runSuite cannot see sibling shards; the parent discards all but one envelope, merges rows by caseIndex, and writes the single terminator (the issue's stated topology). Returned RunCounts are per-shard; the parent sums.
  • Validation: loud, before any instantiate — integers, count >= 1, 0 <= index < count.
  • Per-case timeout semantics unchanged; shard absent is byte-identical to today.

Worker pool stays consumer-side, as the issue argues (imports are live functions and cannot cross postMessage).

Tests

ct-runner/tests/shard_test.ts (5): partition identity (union == unsharded, disjoint), suite-order restoration from merged stripes, param validation, shard × only-filter interaction, shard-absent byte-identity.

Gates

just test-ct-runner — 22 passed / 0 failed (goldens unchanged). Full runtime/conformance lanes ran green on the same tree under PR #112's gate pass.

Implemented by a coder subagent against the issue contract; reviewed by the orchestrator (one review addition: the per-shard RunCounts sentence). One flag from the track, for the record: runCases/harness.mjs live in the external polymorph-test repo, so the mirrored semantics come from the issue text rather than a locally cross-checked source.

@lann
lann enabled auto-merge August 11, 2026 21:48
@lann
lann merged commit 3402055 into main Aug 11, 2026
4 checks passed
@lannbot
lannbot deleted the ct-runner-shard-110 branch August 23, 2026 16:51
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.

ct-runner: shard option on runSuite (the serial case loop is a consumer's CI tail)

1 participant