Skip to content

Integrate the bfp16ebs8 vendor experiment: XBFP container and on-metal suite (#148) - #165

Draft
aravishankar-mp wants to merge 1 commit into
mainfrom
codex/xdna-bfp-experiment
Draft

Integrate the bfp16ebs8 vendor experiment: XBFP container and on-metal suite (#148)#165
aravishankar-mp wants to merge 1 commit into
mainfrom
codex/xdna-bfp-experiment

Conversation

@aravishankar-mp

Copy link
Copy Markdown
Contributor

Why

Issue #148 crate integration (design: docs/plans/issue-148-bfp16ebs8-vendor-tier.md, on PR
#161's branch): the AMD bfp16ebs8 vendor experiment's XBFP container, its load_program
arm, the vendored #146 reference model as a host-runnable test target, and an on-metal suite in
its own test file. Draft until two gates clear: PR #161 (which carries the probe pipeline
that builds the fixture and the docs this references) and the P6 question below.

The container carries only shape and payload; the slot plan is derived, never self-declared.
Loading validates the experiment's own immutable target identity — presenting any other
identity (including a TOSA target) is a relabeling attempt and is rejected — then translates
into the internal precompiled form so executable construction and submission reuse the one
audited path. Nothing is advertised: no TosaCapabilityProvider row, no TOSA format
acceptance, no protocol value.

Proven on the reference NPU (fail-loud lane, 1022:17f0): the full guest-quantized MXINT8
MATMUL lifecycle at K = 512 is bit-exact against the fold oracle; foreign identities are
rejected at load; the fixture's derivation is pinned. The vendored model's nine silicon-fixture
tests also run on every host without an NPU.

The important finding is a falsification. The planned accumulation contract — per-step FP32
round-to-nearest-even in ascending-k order — is wrong at tie-adjacent steps. Probe P6
(tests/bfp_p6_probe.rs, manual on-metal measurements, findings in its module doc) shows the
mac chain is serial with no guard bits persisting across an X, d, −X sequence, yet crafted
exact ties break toward zero while an organic mid-chain tie broke away from zero — refuting
RNE, floor, to-odd, half-away, half-toward-zero, and every wider-precision single-rounding
model. Until P6 pins the real rule, the order-contract hardware test is quarantined behind an
#[ignore] naming the reason, and the tier claims bit-exactness only away from exact ties.
Shipping the falsified oracle as a green test would have been worse than shipping no test.

Compatibility

  • No wire effect. This changes no accepted or emitted protocol bytes. The format
    constant is backend-local and the experiment is reachable only by presenting its own
    identity.

Checklist

  • Does not alter payload lengths, ownership, reset, error, timeout, or feature-negotiation
    behavior.
  • Authoritative inputs not regenerated.
  • Public Rust API additions called out: bfp_experiment module (format constant, identity,
    parse/encode). Existing APIs unchanged.
  • No dependency changes; no platform behavior moved into a portable crate.
  • No unsafe code added.
  • The experiment remains unadvertised and documented as out of scope for TOSA capability.

Verification

cargo fmt --all -- --check
cargo clippy -p virtio-accel-xdna --all-targets --all-features --no-deps -- -D warnings
cargo test --workspace --all-targets
VIRTIO_ACCEL_HRX_LIB_DIR=/tmp/fakelib cargo clippy -p virtio-accel-xdna --all-targets --all-features --no-deps -- -D warnings

On metal (v2026.08 toolchain, HRX 2026.07.30):

VIRTIO_ACCEL_XDNA_REQUIRE_HARDWARE=1 cargo test -p virtio-accel-xdna --test bfp_experiment -- --test-threads=1
# 12 passed; 1 ignored (the quarantined order-contract test)
cargo test -p virtio-accel-xdna --test bfp_p6_probe -- --ignored --nocapture
# manual P6 measurements

…on-metal suite (#148)

The XBFP flavor-1 container (magic/version/flavor/shape header, derived
slot plan, checked framing) loads through a new format arm that
validates the experiment's own immutable target identity and translates
into the internal precompiled form, so executable construction and
submission reuse the one audited path. The compiled fixture is the
two-input K=512 kernel from the probe pipeline; the vendored #146
reference model doubles as a host-runnable test target that replays the
recorded silicon planes.

On the reference NPU: the full guest-quantized MXINT8 MATMUL lifecycle
is bit-exact against the fold oracle, foreign target identities are
rejected at load, and the fixture's slot plan derivation is pinned.

The accumulation-order test is quarantined behind an ignore: probe P6
(bfp_p6_probe.rs, manual) proved the mac chain serial with no
persistent guard bits, but its tie rounding matches no single model --
crafted exact ties break toward zero while an organic mid-chain tie
broke away -- so the per-step-RNE oracle is falsified at tie-adjacent
steps and the tier cannot claim bit-exactness there until P6 pins the
real rule. That finding, not a green suite, is this change's most
important output.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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