Skip to content

omarchy-ane-smoke: packaged add-fixture smoke; promotion golden and regression rule - #50

Merged
joshuaswarren merged 1 commit into
mainfrom
agent/omarchy-ane-smoke
Oct 2, 2026
Merged

joshuaswarren merged 1 commit into
mainfrom
agent/omarchy-ane-smoke

Conversation

@joshuaswarren

Copy link
Copy Markdown
Owner

The community collector runs a packaged omarchy-ane-smoke and keeps its JSON under runtime.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 in fixtures/h14-anec/add, 20 calls, each bit-exact against the exact fp16 sum of fixed inputs.

  • packaging/omarchy-ane-smoke: one omarchy-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, 20 sha256 (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.lock when that file exists and is writable.
  • Golden 94041b7c..., equal to the ane-run --check add C oracle on the same inputs. 54 of the 512 lanes are ties that ties-to-even gets wrong.
  • M1 family: exit 2. No H13 add program has run through ane-run on a device (receipt lists what is missing).
  • omarchy-ane-check --smoke runs 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 prints REVERT until a clean row lands.
  • README "Promotion", "Regression", "Verifying it works"; CHANGELOG Unreleased; CI runs tools/test_ane_smoke.py.

Host tests: test_ane_smoke ok, test_promotion_check ok, test_ane_m2 ok. No device ran this change; receipts/2026-10-02-omarchy-ane-smoke/ has the device command.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T00:56:23.008645Z 4cd7ad6 PR opened
🔒 Security Review ✅ Completed 2026-10-02T00:57:18.160285Z 4cd7ad6 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +136 to +138
if not os.access(path, os.W_OK):
yield
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@joshuaswarren
joshuaswarren merged commit 50958be into main Oct 2, 2026
2 checks passed

@contextmanager
def lock(path, deadline):
if not os.access(path, os.W_OK):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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.

@kilo-code-bot

kilo-code-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packaging/omarchy-ane-smoke 136 The flock on /var/tmp/ane-run.lock is skipped entirely when the file does not exist yet (os.access is False), so on a fresh Mac the smoke runs with no exclusion against other ane-run callers.

SUGGESTION

File Line Issue
packaging/omarchy-ane-smoke 126 subprocess.run(..., timeout=30) on omarchy-ane-firmware-fetch --check has no try/except, so a timeout/OSError escapes prepare() and the tool prints a traceback with no JSON on stdout, breaking the collector contract and omarchy-ane-check --smoke.
Files Reviewed (9 files)
  • packaging/omarchy-ane-smoke - 2 issues
  • packaging/omarchy-ane-check - 0 issues
  • tools/promotion_check.py - 0 issues
  • tools/test_ane_smoke.py - 0 issues
  • tools/test_promotion_check.py - 0 issues
  • .github/workflows/dt-overlays.yml - 0 issues
  • README.md - 0 issues
  • CHANGELOG.md - 0 issues
  • receipts/2026-10-02-omarchy-ane-smoke/README.md - 0 issues

Fix these issues in Kilo Cloud


Reviewed by free · Input: 0 · Output: 0 · Cached: 0

joshuaswarren added a commit that referenced this pull request Oct 2, 2026
…, packaged m1n1 verified)

The Unreleased entries (#32-#50) go into 0.4.0 with honest known limits; the README M2 Max row is on by default and the fw_alias_reserved caveat is gone. CHANGELOG.md and README.md only.
joshuaswarren added a commit to joshuaswarren/omarchy-pkgs that referenced this pull request Oct 2, 2026
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.
@joshuaswarren
joshuaswarren deleted the agent/omarchy-ane-smoke branch October 3, 2026 12:41
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