Repository navigation
omarchy-ane-smoke: packaged add-fixture smoke; promotion golden and regression rule - #50
Conversation
…romotion golden + regression rule packaging/omarchy-ane-smoke runs fixtures/h14-anec/add 20 times through omarchy-ane-run (tools/ane-run, one process per call, so every call writes fresh zeroed buffers) and prints one JSON line for the community collector: name add-fixture, chip, 20 sha256 of the 512 valid output lanes, golden_sha256, errors, min_ms, median_ms. The golden is the exact fp16 sum (ties away from zero) of fixed inputs, 94041b7c..., equal to the ane-run --check add C oracle; 54 lanes are ties that ties-to-even gets wrong. Exit 0 = 20/20 bit-exact, 1 = a call failed or was not exact or passed the 60 s limit, 2 = unavailable (no fixture for the chip, driver not bound, firmware or a package file missing, lock held). The M1 family gets exit 2: no H13 add program has run through ane-run on a device. It holds /var/tmp/ane-run.lock when the file exists and is writable. omarchy-ane-check --smoke runs it after the checks pass (ok / note / FAIL). tools/promotion_check.py takes the golden from the smoke (T6020, T6021, T6022, T8112), drops the encoder hash, and adds the regression rule: an on-by-default chip whose latest row shows check not ready or a fault line prints REVERT until a clean row lands. tools/test_ane_smoke.py covers pass, one mismatch, unavailable, timeout, missing fixture and a held lock with a stub runner that computes the add from its input files.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cd7ad65b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,228 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
Recreate the commit with the required identity
The reviewed commit records both its author and committer as Codex <codex@openai.com>, but this repository requires Joshua Warren <816217+joshuaswarren@users.noreply.github.com> and explicitly prohibits bot identities. The commit therefore cannot be accepted as delivered and must be recreated with the mandated author and committer metadata.
AGENTS.md reference: AGENTS.md:L250-L257
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not reproduced. GitHub records commit 4cd7ad6 with author and committer Joshua Warren <816217+joshuaswarren@users.noreply.github.com> (GET /repos/joshuaswarren/omarchy-ane/commits/4cd7ad6: author 2026-10-02T00:53:13Z, committer 00:53:17Z). No change.
| if not os.access(path, os.W_OK): | ||
| yield | ||
| return |
There was a problem hiding this comment.
Always acquire the shared ANE lock
When /var/tmp/ane-run.lock does not exist, as on a fresh installation, os.access(..., W_OK) is false and this branch runs all 20 hardware submissions without creating or locking the file. Two simultaneous first smoke runs, or a race with another tool that creates and flocks this path, can therefore submit to the ANE concurrently despite using the same advertised serialization lock; open/create the lock file first and then acquire flock rather than treating absence as permission to proceed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Kept as specified: the smoke takes the lab lock only when the file exists and is writable, and it creates no file outside its own temp dir. The lock is a courtesy to lab timing runs, not a safety guard: the driver serializes submissions, and four concurrent ane-run workers ran 2040 executions exact on T6021 (receipts/2026-09-30-t6021-stock-mailbox).
|
|
||
| @contextmanager | ||
| def lock(path, deadline): | ||
| if not os.access(path, os.W_OK): |
There was a problem hiding this comment.
WARNING: The lock is silently skipped when /var/tmp/ane-run.lock does not exist yet
os.access returns False for a missing file, so on any Mac that has never run a lab job (flock /var/tmp/ane-run.lock ... creates the file) this smoke takes no lock at all. Every other ANE caller in this repo serializes on that path, so on exactly the machines this tool targets for a fresh install two concurrent omarchy-ane-check --smoke runs, or a smoke overlapping any direct ane-run, submit to the ANE at the same time — the case the driver docs and AGENTS.md treat as unsafe.
Creating the file when the parent directory is writable keeps the same "never fails" property while making exclusion the default:
| if not os.access(path, os.W_OK): | |
| if not os.access(path.parent, os.W_OK) or not os.access(path, os.F_OK): |
(That still needs the open mode to create; alternatively try: fh = open(path, "a") except OSError: yield; return.) Either way, please state in the docstring whether "file absent" means "no exclusion" or "create and exclude".
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| why = f"{MODULE} is bound to no device. Read the reason with: journalctl -k -g {MODULE}" | ||
| fetch = tool("omarchy-ane-firmware-fetch") | ||
| if fetch: | ||
| p = subprocess.run([str(fetch), "--check", "--root", str(root)], capture_output=True, text=True, |
There was a problem hiding this comment.
SUGGESTION: An unhandled subprocess.TimeoutExpired here breaks the stdout JSON contract
This subprocess.run has a 30 s timeout but no try/except. If omarchy-ane-firmware-fetch --check ever hangs or is interrupted, the exception escapes prepare(), main() never reaches emit(), and the tool exits with a Python traceback and no JSON line on stdout — the collector reads runtime.omarchy_ane.smoke from stdout, and omarchy-ane-check --smoke would report the traceback as the smoke line. Every other unavailable condition in this file goes through raise Unavailable and exit 2, so this one path should do the same:
| p = subprocess.run([str(fetch), "--check", "--root", str(root)], capture_output=True, text=True, | |
| try: | |
| p = subprocess.run([str(fetch), "--check", "--root", str(root)], capture_output=True, | |
| text=True, timeout=30) | |
| except (OSError, subprocess.SubprocessError): | |
| raise Unavailable(f"omarchy-ane-firmware-fetch --check failed: {fetch}") |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (9 files)
Fix these issues in Kilo Cloud Reviewed by free · Input: 0 · Output: 0 · Cached: 0 |
omarchy-ane-smoke (joshuaswarren/omarchy-ane#50) runs the add program 20 times on the ANE and checks each output against the exact fp16 sum. It runs omarchy-ane-run from its own directory with the program in /usr/share/omarchy-ane/fixtures. - build(): make tools/ane-run. It links libane statically and needs only libc and libm at run time. libdrm is a makedepend for drm.h. - check(): add tools/test_ane_smoke.py (stub runner, fake root, no device). - package(): install omarchy-ane-smoke, tools/ane-run as omarchy-ane-run, and fixtures/h14-anec/add/program-0.anec.
The community collector runs a packaged
omarchy-ane-smokeand keeps its JSON underruntime.omarchy_ane.smoke. The planned smoke was the whole Parakeet encoder. That program is about 450 MB of Apple-compiled ANEC, so no package can ship it. This PR adds a smoke a user's Mac can run: the 20 KiB add program infixtures/h14-anec/add, 20 calls, each bit-exact against the exact fp16 sum of fixed inputs.packaging/omarchy-ane-smoke: oneomarchy-ane-run(tools/ane-run --check add --time) process per call, so every call writes fresh zeroed buffers. stdout is one JSON line:name(add-fixture),chip, 20sha256(512 valid lanes each),golden_sha256,errors,min_ms,median_ms. Exit 0 means 20/20 exact. Exit 1 means a call failed, was not exact, or ran past 60 s. Exit 2 means no smoke here: no fixture for the chip, driver not bound, firmware or a package file missing, or the lock held. It holds/var/tmp/ane-run.lockwhen that file exists and is writable.94041b7c..., equal to theane-run --check addC oracle on the same inputs. 54 of the 512 lanes are ties that ties-to-even gets wrong.ane-runon a device (receipt lists what is missing).omarchy-ane-check --smokeruns it after the checks (ok / note / FAIL).tools/promotion_check.py: golden from the smoke (T6020, T6021, T6022, T8112). The encoder hash is gone. New regression rule: an on-by-default chip whose latest row shows check not ready or a fault line printsREVERTuntil a clean row lands.tools/test_ane_smoke.py.Host tests:
test_ane_smokeok,test_promotion_checkok,test_ane_m2ok. No device ran this change; receipts/2026-10-02-omarchy-ane-smoke/ has the device command.