Skip to content

feat(sweep): spec provenance stamp, intent compilation, declared ladder trims#16

Merged
dutifulbob merged 3 commits into
mainfrom
feat/spec-provenance
Jul 5, 2026
Merged

feat(sweep): spec provenance stamp, intent compilation, declared ladder trims#16
dutifulbob merged 3 commits into
mainfrom
feat/spec-provenance

Conversation

@dutifulbob

Copy link
Copy Markdown
Member

Opened on behalf of Onur Solmaz (osolmaz).

Summary

The four GB10 sweeps ran from hand-written spec files with silently trimmed 32k/64k ladders, and nothing could tell a generated spec from a hand-edited one.
This change makes sweep plan the intent surface and the spec a verifiable build artifact.
Machine-specific runtime choices become generator flags, deliberate concurrency caps become declared trims with reasons, and every generated spec carries a content-hashed provenance stamp that reports verify from the stored bytes.
This is PR 3 (final) of docs/2026-07-05-report-integrity-plan.md.

What Changed

The spec stops being an editing surface; intent goes through the generator and everything else is labeled.

  • sweep plan gains --vllm-command, --gpu-memory-utilization, --kv-cache-memory-bytes, and repeatable --trim <context>=<max>:<reason>. Trims cap the generated ladders (and profile max_num_seqs) and require a reason.
  • Generated specs carry generator: {tool, version, intent, ladder_trims, content_hash} (internal/artifact/provenance.go); the hash covers the canonical spec document minus the stamp, computed via generic-map canonicalization so any verifier gets identical bytes.
  • bench run verifies the stamp at load time (against the raw file, before defaults mutate anything) and prints spec provenance: generated|edited|custom.
  • Reports and the viewer verify provenance themselves from the artifact's stored original spec and show a Spec metadata item: "Generated default sweep (localperf sweep plan)" or "Custom grid (hand-authored / edited after generation)".
  • For verified generated specs, trimmed ladder points render as synthesized rows — "trimmed by author: " — inside their declared context's table, exactly like adaptive skips.
  • Docs: the default-sweep doc gains a Spec Provenance section routing all spec creation through the generator; README summarizes it; sweepplan golden updated.

Testing

Unit tests cover stamping, hash verification (generated/edited/custom), trim capping, runtime intent, trim validation branches, and report rendering of provenance + trimmed rows.

  • go test ./..., go vet, gofmt — clean
  • simpledoc check, slophammer check/dry, scripts/check-crap.sh, golangci-lint — clean
  • AGENTS.md dry-run + artifact check — ok (prints spec provenance: custom for the example spec, as expected)
  • End-to-end smoke: sweep plan --trim '64k=8:12 GiB KV budget' --vllm-command … produces a stamped spec with the 64k ladder capped at 8; bench plan accepts it.
  • Not tested locally: a full GPU sweep from a stamped spec.

Risks

Hand-written specs keep working — they are just labeled "Custom grid".
The hash intentionally breaks on any edit to a generated spec; regenerate through sweep plan instead of editing.
Older artifacts without stored original specs render as "Custom grid (hand-authored)", which is accurate.

…er trims

sweep plan now covers the machine-specific intent that forced
hand-authoring (vllm runtime path, GPU memory utilization, KV cache
bytes) and accepts declared ladder trims with reasons. Generated specs
carry a generator stamp with a canonical content hash; bench run prints
the verified provenance and reports label runs Generated default sweep
or Custom grid from the stored spec bytes, never on trust. Trimmed
points render like adaptive skips with their reason, never as holes.
…ow real rows

Codex review round 1: the content hash now excludes only
generator.content_hash itself, so tampering with declared trims or
intent demotes the spec; bench run verifies provenance from the raw
file bytes; trims must reference generated contexts; synthesized
trimmed rows never overwrite real measurements.
@dutifulbob

Copy link
Copy Markdown
Member Author

Final report: PR 3 (final) of docs/2026-07-05-report-integrity-plan.md. Codex round 1 found 1 P1 + 3 P2 (hash excluded stamp metadata; runner verified re-marshaled bytes; synthetic trim rows could shadow real measurements; trims accepted for absent contexts) — all fixed in be6af8f with regression tests. Round 2 found a single P2 (bench loader not following --vllm-command) — fixed in cf9539a; per the review-loop rule a P2-only round ends the loop. Validation: go test ./..., go vet, gofmt, simpledoc, slophammer check/dry (incl. dependency boundaries), check-crap.sh, golangci-lint, AGENTS.md dry-run + artifact check, plus an end-to-end smoke: sweep plan --trim '64k=8:…' --vllm-command … produces a stamped spec with the capped ladder that bench plan accepts. CI green. Merging per explicit authorization.

@dutifulbob dutifulbob merged commit e292cfc into main Jul 5, 2026
2 checks passed
@dutifulbob dutifulbob deleted the feat/spec-provenance branch July 5, 2026 08:48
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.

2 participants