Skip to content

det sweep: copy forward verdicts by content key, prove only what moved, work-sized shards up to 20 #4814

Closed

Description

@squid-protocol

Problem (measured 2026-10-09). Det Sweep takes 25–33 min per PR, but its proving steps take only 6–10 min per shard. The rest is waiting for runners at the job level. Shards started 2–7 min after plan, and det started 8 min after the last shard (run 37967292684). The repo starts ~32 workflows (~40 jobs) per PR push, so one PR fills the org's concurrent-job cap (probably 20 on Free), and every other PR and the evidence bot queue behind it. Meanwhile the planner (tests/tools/det_sweep_plan.py) does a full sweep for any translator, harness or tools change, and shards are balanced by name (no det_sweep_durations.json is committed).

Local timings (full non-Db2 sweep, 80 cases): ~68 runner-minutes of proving; the longest case ~3.8 min (carddemo-trnrpt, carddemo-posttran, cbsa-updacc-generated, carddemo-dailyval). Longest shard by shard count: 6 → ~11 min, 10 → ~7 min, 20 → ~3.8 min, which is the floor.

Proposal (owner-approved direction, 2026-10-09)

  1. Verdict key per case: a hash of everything the det verdict depends on:
  2. Verdict cache on main, outside the git tree (an Actions cache or artifact; never committed, so it can't churn like the ledger did, see det_coverage_ledger: keep unchanged entries (stops the evidence-refresh loop that dirties every ledger PR) #4813 / bot-generate cics_spec_status.md (like the evidence report) and per-case coverage-ledger files, to end merge-main + re-render cycles #4789). Each key maps to verdict, coverage, duration and the proving run/sha.
  3. Copy forward on PRs. plan translates every case and computes the keys. A hit carries the verdict forward, labelled "carried from run X @ sha". A miss is proven. When in doubt (an unmapped file, an unknown component), prove.
  4. Prioritize misses:
    1. cases whose port changed;
    2. cases re-keyed only by a harness or oracle component;
    3. known-unstable cases;
    4. longest-first within shards.
      Report the first failure early as an annotation, but finish the list so the ratchet sees every case.
  5. Work-sized shards, up to 20. N = ceil(planned minutes / ~4), capped at 20, balanced by LPT on recorded durations (commit or cache det_sweep_durations.json, refreshed by the nightly run). A typical PR starts 0–2 shards; a full sweep starts 15–20.
  6. Main moved under an open PR. Recompute the PR's keys on the new main; rerun only the cases whose key changed (works with merge_train today, and a GitHub merge queue later).
  7. Honesty check. The nightly sweep ignores the cache, proves everything fresh, and fails if any carried verdict differs from the fresh one (a key that missed a dependency). Carried verdicts never feed evidence records, which keep their own proofs.

Also in scope (cheap runner savings): fold the small audit workflows (ruff, mypy, dead-key, AST/tree-sitter accuracy, golden guard and similar) into one job, so ~10 jobs of setup per PR become 1.

Out of scope / owner decision: a plan upgrade (Team: 60 concurrent jobs) or self-hosted runners.

Acceptance.

  • A PR that changes 1–3 ports proves only those cases plus their dependents.
  • A harness change proves only the cases that use the changed component.
  • A full sweep runs on ≤ 20 shards, with its longest shard ~4–5 min of proving.
  • The nightly no-cache audit passes, and a test shows it fails on a planted wrong carried verdict.
  • Det Sweep wall clock on a typical PR is under 10 min.

Order. Start after #4789 (per-case ledger) lands, since both change how sweep outputs are stored; #4813 (ledger idempotency) is a prerequisite.

🤖 Generated with Claude Code

Activity

  1. added
    enhancement
    ci-cd
    priority: high
    on Oct 9, 2026
  2. squid-protocol commented on Oct 10, 2026

    @squid-protocol
    OwnerAuthor

    Progress (2026-10-10):

    🤖 Generated with Claude Code

  3. squid-protocol commented on Oct 10, 2026

    @squid-protocol
    OwnerAuthor

    Done; closing.

    Not done and moved: per-component keys for harness/oracle changes → #4847. Dropped: caching the base translation (Actions cache is per-branch, so the hit rate is too low).

    🤖 Generated with Claude Code

  4. added
    scope:infra
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci-cdenhancementpriority: highscope:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions