Skip to content

shakedown: wave 12: auto-select preset from detected hardware (--target now optional)#9

Merged
ugglr merged 1 commit into
mainfrom
wave-12-autotarget
Jun 3, 2026
Merged

shakedown: wave 12: auto-select preset from detected hardware (--target now optional)#9
ugglr merged 1 commit into
mainfrom
wave-12-autotarget

Conversation

@ugglr

@ugglr ugglr commented Jun 3, 2026

Copy link
Copy Markdown
Owner

You shouldn't have to type your SKU when the machine already knows it. ./run with no --target now auto-selects the matching preset from the detected hardware, so the right chassis class, inventory asserts, and golden baseline all apply with nothing to type.

What this adds

  • Preset auto-selection. With no --target, the orchestrator matches the machine's chip / memory / model against the presets in targets/ and uses the one that fits (printing which). Exactly one match wins; zero or several falls back to the prior chassis-auto-detect-with-asserts-skipped behavior.
  • --target becomes an optional override for asserting an expected SKU ("I ordered a Max, not a Pro") or forcing a specific preset.
  • The one-command examples across README, the Store Day Checklist, and the Benchmark Reference drop the manual --target.

Why it's safe

The match uses the SAME sources as the inventory asserts: chip_type/cpu_type and round(hw.memsize / 1024^3) and machine_model + machine_name. So an auto-selected preset always passes its own asserts (no "matched then failed" inconsistency). The guard [[ -z TARGET && -z CHASSIS_CLASS ]] preserves every existing explicit-input path unchanged: pass --target or set CHASSIS_CLASS and auto-select stands down.

Why python, not bash

The match parses JSON presets, reads sysctl hw.memsize as an int, and globs a directory. macOS ships no jq and bash can't do this cleanly, so it goes through Python exactly like every other JSON touch in the repo.

Verification

Live on this Intel box: ./run auto-selected mbp-16-intel-2019 (chassis intel-laptop) from the detected i7 / 32 GB / "16" model; an explicit --target mbp-16-m5-max-64 overrode it with no auto-match. Unit-tested the matcher: single match wins, ambiguous (2 presets) falls back, wrong-memory and unknown-chip fall back. Lint clean (shellcheck, all PYEOF heredocs ast.parse, zero em dashes). Passed dad review: simplicity ship-it, correctness zero-defects (the auto-selected-always-passes-asserts claim verified source-by-source), consistency one-voice.

@ugglr
ugglr merged commit 59ce8c6 into main Jun 3, 2026
1 check passed
@ugglr
ugglr deleted the wave-12-autotarget branch June 3, 2026 08:17
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