Skip to content

T6021: read-only probe and receipt for the ANE0 AXI2AF bridge tunables - #25

Merged
joshuaswarren merged 2 commits into
mainfrom
agent/t6021-af-bridge
Oct 1, 2026
Merged

joshuaswarren merged 2 commits into
mainfrom
agent/t6021-af-bridge

Conversation

@joshuaswarren

Copy link
Copy Markdown
Owner

Adds ane/t6021/probes/ane_afbridge_probe.c, a read-only module that reads the 26 ANE0 AXI2AF bridge registers that macOS programs, and the receipt receipts/2026-10-01-t6021-af-bridge/README.md.

  • The macOS 13.5 hv trace writes the 26 tunables at the ANE engine base 0x284000000 (tools/m2hv_replay-trace-135.txt events 2816-2841). All 26 values pass the 27.0 mask test.
  • ane_t6021 P-1 already writes two of them (eng+0x000 = 0x10, eng+0x400 = 0x40010001) with the T8103 values. Both fail the macOS masks.
  • The probe maps the page non-posted, reads only while ane_sys and the seven islands are on, waits 3 s, and logs each address before its read. It never writes.
  • It is built against the stock 7.1.13-3-1-ARCH headers with W=1 and no warnings. sha256 5a235996a517624673921f0f9e48366b1f250e5214b5dcced2cc27706f31d2ac, vermagic equal to the running kernel.

The probe has not run. Running it needs an owner go; the receipt has the procedure and the pass/fail criteria.

ane/t6021/probes/ane_afbridge_probe.c reads the 26 registers that macOS
programs on the T6021 ANE0 AXI2AF bridge (base 0x284000000) through a
non-posted mapping. It reads only when ane_sys and the seven compute
islands are on, waits 3 s, checks the guard again before each read, and
logs each address before its read. It never writes.
…t run

The macOS 13.5 hv trace writes the 26 bridge tunables at the ANE engine
base 0x284000000, so the probe reads that page. ane_t6021 P-1 already
writes two of the 26 (eng+0x000, eng+0x400) with the T8103 values,
which fail the macOS masks. The receipt gives the PA table, the read
risk, the probe build (stock 7.1.13-3-1-ARCH headers), the run procedure
and the pass/fail criteria.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 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-01T14:29:48.027303Z 406b3cc 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.

@joshuaswarren
joshuaswarren merged commit 23e8ad1 into main Oct 1, 2026
1 check passed

@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: 406b3cc0e7

ℹ️ 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".

/* ponytail: netconsole is an nbcon kthread and pr_flush() is not
* exported; 50 ms lets the line leave before the read. */
msleep(50);
pr_crit("%#llx = %#010x\n", pa, readl(afb + afb_off[i]));

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 Pin the power domains across each register read

If auto-gating drops ane_sys or an island during the 50 ms sleep, this readl() executes after the only power check and can access the powered-off engine window; the receipt identifies such an access as capable of hard-resetting the M2. Hold the relevant runtime-PM/genpd reference throughout the scan rather than relying on a check performed before the logging delay.

Useful? React with 👍 / 👎.

Comment on lines +8 to +10
macOS 27.0 (`AppleT6020PMGR::applyBridgeTunables`, the same table in the
T6020 and T6021 kexts) programs 26 registers on the ANE0 AXI2AF bridge.
Each is a 32-bit read-modify-write: `reg = (reg & ~mask) | value`. m1n1

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 Cite the exact source commit for the tunable table

These claims establish the 26-register experiment and its read-modify-write semantics, but they name only a macOS version and symbol, with no exact source/extraction commit for the masks and values. Consequently, the central comparison table cannot be audited or reproduced from the receipt as required for register claims.

AGENTS.md reference: AGENTS.md:L225-L228

Useful? React with 👍 / 👎.

Comment thread ane/t6021/probes/Makefile
@@ -0,0 +1,11 @@
ifneq ($(KERNELRELEASE),)

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 this commit with the mandated Git identity

The reviewed commit is authored and committed as Codex <codex@openai.com>, whereas this repository requires both identities to be Joshua Warren with 816217+joshuaswarren@users.noreply.github.com; recreate the proposed commit with the required author and committer metadata before landing it.

AGENTS.md reference: AGENTS.md:L250-L257

Useful? React with 👍 / 👎.

* the 3 s settle wait and again before every read. Each line is logged
* before its read, so a fault leaves the address as the last line.
* Output: "ane_afbridge_probe: 0x<PA> = 0x<value>", the input format of
* af_bridge_compare.py check. Nothing stays mapped after init.

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: Dangling reference to a comparison tool that does not exist

The header promises output in "the input format of af_bridge_compare.py check", but no af_bridge_compare.py exists anywhere in the repository (grep -rn af_bridge_compare matches only this line). The receipt's step 5 also describes the comparison as manual, so the documented consumer of this probe's output is missing; either add the checker or drop the claim so a reader does not wait for a tool that will never appear.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

unsigned int i;
int ret = 0;

if (!of_machine_is_compatible("apple,t6021"))

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 hard-coded bridge base is never validated against the live DT

AFB_BASE (0x284000000) comes from the macOS kext's ADT reg[38], which the receipt itself records as "still unconfirmed" (README finding 1), and PS_BASE is likewise hard-coded rather than taken from the DT pmgr resource the driver maps with devm_of_iomap(..., 1, ...). The only cross-check is of_machine_is_compatible. If either address is wrong, ioremap_np succeeds and the loop reads arbitrary physical MMIO through a non-posted mapping — the bus-error/hard-reset class the receipt's Risk section is built around. A cheap of_address_to_resource()/of_find_matching_node range check that refuses unless both PAs fall inside the live ane engine and pmgr windows would turn a hard reset into a clean -ENODEV.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.


insmod takes about 4.3 s.
4. If the log shows a `refused` line, no engine read happened. Repeat
step 3 without `flock`, while an encoder process runs.

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: Step 4 contradicts the Risk section and re-runs the probe against live ANE work with no exclusion

The Risk section requires running the probe "with no GPU job active" (line 126-127), yet this step deliberately repeats the run while an encoder process is running. The flock in step 3 only serializes probe runs; the module takes no reference to, and no lock with, ane_t6021, so the reads land on engine registers while firmware is live. That contradicts the receipt's own fault classes (an engine read in the wrong power state is what hangs this SoC) and turns a documented SAFE-STOP retry into a materially riskier run. Either state explicitly that the encoder must be idle-but-powered (so ane_sys and the islands are on) with the hard-reset risk re-accepted, or drop the concurrency instruction.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

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

Copy link
Copy Markdown

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
ane/t6021/probes/ane_afbridge_probe.c 16 Header cites af_bridge_compare.py as the consumer of the probe output; no such tool exists in the repo
ane/t6021/probes/ane_afbridge_probe.c 61 Hard-coded AFB_BASE/PS_BASE (receipt records the ADT base as unconfirmed) are never range-checked against the live DT windows, so a wrong PA reads arbitrary MMIO and hard-resets instead of refusing
receipts/2026-10-01-t6021-af-bridge/README.md 145 Run step 4 contradicts the Risk section ("no GPU job active") and re-runs the probe against live ANE work with no lock against ane_t6021
Files Reviewed (3 files)
  • ane/t6021/probes/Makefile - 0 issues (git-identity finding on this file already covered by an active comment)
  • ane/t6021/probes/ane_afbridge_probe.c - 2 issues
  • receipts/2026-10-01-t6021-af-bridge/README.md - 1 issue

Notes: the 26-offset table was re-verified against tools/m2hv_replay-trace-135.txt events 2813-2842 and the P-1 table in ane/t6021/ane_t6021_boot.h — the offsets, values, mask-test claims and the 0x000/0x400 NOT-applied expectations all check out.

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 1, 2026
The Unreleased entries of #28 and the #25, #27, #29 tools and #22/#26 receipts go into 0.4.0, with honest known limits. CHANGELOG.md only.
@joshuaswarren
joshuaswarren deleted the agent/t6021-af-bridge 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