feat(cli): foundry inspired features - #255
Merged
Merged
Conversation
…mands
Implement tile-forge parity across the CLI and config layer:
- Global flags: --verbose/-v (Count), --quiet, --json, --color, --threads/-j,
--profile (+ TILE_PROFILE env var)
- Layered TileConfig via figment: defaults → extends base → tile.toml →
[profiles.<name>] → TILE_* env vars → CLI flags
- Config sub-tables [bench], [build], [runner] with effective_*() accessors
that take precedence over backward-compat flat fields
- Extends/inheritance: `extends = "~/.metaltile/global.toml"` in tile.toml
- Profile system: `[profiles.ci]` sections with per-profile sub-table overrides
- Env-var interpolation: ${VAR} / ${VAR:-default} in string config values
- Unknown-key warnings and deprecated-field-coexistence warnings
- New subcommands: `tile config` (print effective config), `tile clean`
(remove build artefacts), `tile completions` (shell completion scripts)
- Positional <path> on bench/test disambiguates to --match-path or --filter
- Structured exit codes via TileExitCode (0/1/2/3/10)
- clap_complete integration for bash/zsh/fish/powershell completions
- add gap-analysis and implementation-plan docs
tile test: - Group tests by kernel suite with 'Ran N tests for kernel_name' header - [PASS] / [FAIL: reason] format with per-test accuracy annotation - Per-suite 'Suite result: ok/FAILED. N passed; M failed; finished in X.XXms' - Failing tests section re-listed at bottom - Overall 'Ran N suites in X.XXms: M passed, K failed (total N tests)' - --fail-fast: stop after first failure - --list / -l: list matching tests without running them tile build: - 'Compiling N kernels with xcrun metal X.Y' header (reads xcrun version) - Clean per-kernel rows without table borders - 'xcrun metal X.Y finished in X.XXs' timing footer - 'Compiler run successful!' or 'Build FAILED. N error(s).' result line
tile test: - Spinner label: "Compiling..." → "Preparing tests..." - -vv: print generated MSL for failing tests - -vvv: print generated MSL for all tests - --show-progress: live [N/M] label indicator on stderr - --summary: per-suite table (Suite/Passed/Failed/Tests/Time) - --detailed (requires --summary): per-test rows (Suite/Test/Result) tile build: - Per-kernel ok lines suppressed at default verbosity (-v to show) - --names/-n: list kernel names + dtypes without compiling
The paths filter was preventing tile.yml from firing on PRs that only touch metaltile-cli or other non-ffai/non-mlx paths. The changes job already gates bench shards at the job level — the trigger-level filter is redundant and causes silent skips.
…ards matrix context is not available in job-level if expressions; split the bench matrix job into bench-ffai and bench-mlx with explicit conditions. Update bench-merge to depend on both.
Collaborator
|
Some nice changes here. Will rebase #247 on this now that it is merged and ensure kosher. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Implements tile-forge CLI parity across the
metaltile-clicrate.Global flags propagated to all subcommands:
--verbose/-v(repeatable count:-v,-vv,-vvv)--quiet,--json(machine-readable output)--color always|auto|never(setsCLICOLOR_FORCE/NO_COLOR)--threads/-j(rayon pool size)--profile/TILE_PROFILEenv var (selects a named config profile)Layered
TileConfigvia figment:extends = "..."base file (tilde-expanded, resolved relative to tile.toml)tile.tomlfound by walking up from CWD[profiles.<name>]section overridesTILE_*environment variablesConfig sub-tables (
[bench],[build],[runner]) witheffective_*()accessors. Env-var interpolation (${VAR}/${VAR:-default}) applied to string fields. Unknown-key and deprecated-coexistence warnings collected and printed after each command.New subcommands:
tile config [--json]— print effective merged configurationtile clean [--snapshots] [--all]— remove build artefactstile completions <shell>— emit shell completion scripts (bash/zsh/fish/powershell)tile build(forge-style):Compiling N kernels with xcrun metal X.Yxcrun metal X.Y finished in X.XXs+Compiler run successful!/Build FAILED. N error(s).name dtypes oklines suppressed by default; shown with-v--names/-n: list kernel names + dtypes without compilingtile test(forge-style):[⠋] Preparing tests...Ran N tests for <suite>→ per-test[PASS]/[FAIL: err=, tol=]→Suite result: ok. N passed; M failed; finished in X.XXsRan N test suites in X.XXs: M passed, K failed (total N tests)-vv: print generated MSL for failing tests-vvv: print generated MSL for all tests--show-progress: live[N/M] labelindicator on stderr before each result--summary: per-suite table (Suite / Passed / Failed / Tests / Time)--detailed(requires--summary): per-test rows (Suite / Test / Result)--fail-fast: stop on first failure--list/-l: list matching tests without runningOther improvements:
<path>onbench/testdisambiguates: contains/or*→--match-pathglob, otherwise →--filtersubstringTileExitCode(0 success, 1 test failure, 2 build failure, 3 regression, 10 config error)Harnessstruct centralises config + global flag access for all commandstile initscaffoldstile.tomlwith correct sub-table format + CI profile exampleCrates affected
metaltile-core(IR types, ops)metaltile-macros(proc macros, body parser)metaltile-codegen(MSL lowering, passes)metaltile-runtime(Metal dispatch)metaltile-std(kernel stdlib, op files)metaltile-cli(tilebinary)Testing
Config unit tests added in
config.rs. All tests pass.Checklist
make clippypasses cleanmake fmt-checkpasses