fix(nfc): put the amiibo model fields in the SDK's order #2505

Open
dazemc wants to merge 2 commits from dazemc/Longshot:fix/nfp-model-info-field-order into main
Contributor

Summary

On main, a Zelda amiibo tapped in Hyrule Field is usually rejected: the game answers "This amiibo is not supported."
for every figure except the one whose per-character amiibo settings happen to match. The tag keeps a figure's model as
character, variant, figure type, model number, series (0x54 to 0x5A, in that order); nn::nfp::ModelInfo keeps it as
character id, series, model number, figure type. GetModelInfo in host/nn_nfp.c copied the tag's seven bytes straight
through, so the game read the figure's type as the series id and the series as the type, and only the matching figure was
accepted.

GetModelInfo now fills the SDK's order: the character id's three bytes copied, the series in [3], the model's number
as a native u16 in [4..5], and the figure's type in [6]. Every figure whose tag says it belongs to a supported series
is accepted. The NFC fixtures also use the shared compiler command parser to preserve Windows compiler paths.

To see the bug on main: build main, put a 540-byte tag file in the NFC folder, run the game windowed, open Insert,
the NFC tab, pick the tag, Tap tag, and walk into Hyrule Field so the game asks for a tag. main reads it (the log
says nfp: the game reads the NFC tag "...") and then answers "This amiibo is not supported." The same tag on this
branch is read and its items arrive.

Read first: host/nn_nfp.c, GetModelInfo (the four changed lines); then tests/test_nfc_model_info_fields.py, which is
the two layouts written down.

The old test was wrong, and that is why main is green. tests/test_nfc_model_info.py asserted the tag's own order —
memcmp(out, cases[i], 4) and out[6] == cases[i][6] — so it agreed with the bug instead of the SDK and passed on
main while the game rejected every other figure. It now asserts the SDK's order (memcmp(out, cases[i], 3),
out[3] == cases[i][6], out[6] == cases[i][3]), and on main it fails with
FAIL case 0: ModelInfo 12 34 56 01 34 12 09, expected character 12 34 56, series 09, number 34 12, type 01. The new
tests/test_nfc_model_info_fields.py says the same thing from both sides: the tag's order in, the SDK's order out.

Fixes #2489.

Rebase status (2026-11-25, current): 9ef83d87f → 01b1be9d1 onto main @ 8f7300756701b7c9a278e576bb075ac20e622a32. Stable patch-id 8ca929a67ccf1bd32058306a193779863dde1a0e is unchanged and main's old-base→new-main file intersection with this PR is empty. The evidence already named below (suite, platform, in-game and measurement, as applicable) therefore still stands at the historical heads that produced it. Earlier rebase notes are history; where they say "this head", they mean the evidence commit named beside that run, not 01b1be9d1.

Testing

Rebase (2026-11-25). Rebased onto origin/main be663a08a30fa953420104d3cef6877bed6674a2. The head this note starts from is 24b97e5f046152efa811f7d68900e9c84038d07c (it had already moved from 1a4a650654 by the Windows-fixture commit 24b97e5f, message and tests only), and the new head is 9ef83d87fe706db5d724930abcdcbbcbcc8cee1d. git diff -U0 6b928cb4d..24b97e5f and git diff -U0 be663a08a3..9ef83d87 hold the identical changed-line set (143 added/removed lines, 0 differing), so the rebase changed none of this PR's content. Main's new commits do touch tests/test_host_guest_writes.py (+7/−7, #2411), which this PR's NFC fixture work edits, so the checks below — already taken on the earlier head 1a4a650654 — are not re-established at this head. The mise run test box stays unticked pending a suite at 9ef83d87fe after the quiet window; the Linux in-game runs and the Windows cross-compile describe host/nn_nfp.c, which main has not changed, and are kept as the record of those heads.

Tested: Linux (kernel 7.3.5), NVIDIA GeForce RTX 4070 Ti, Vulkan 1.4, driver 0x9b124100, windowed runs of the built
runtime (not headless): a 540-byte synthetic Yunobo tag (a valid NTAG215 container, its model block at 0x54 reading
01 0c 00 00 a6 04 09) in a temporary LONGSHOT_NFC_DIR, held to the reader from Insert, the NFC tab, then tapped in
Hyrule Field.

  • This branch's tree (v3.2.0-15-g9046a8d75-dirty, built from 9046a8d75019 with the fix applied, before it was
    committed): the game reads the tag and the figure's items arrive. Log /tmp/opencode/longshot-2489/runs/fix-e/log.txt,
    screenshots /tmp/opencode/longshot-2489/runs/fix-e-scan3.png and fix-e-scan2.png.
  • main (v3.2.0-12-g8aa5ab876): the same tag is read and the game answers "This amiibo is not supported." Log
    /tmp/opencode/longshot-2489/runs/base-a/log.txt, screenshot /tmp/opencode/longshot-2489/runs/base-a-scan2.png.

Both runs are windowed with 0 vk: no window lines. None of this leaves the PC: the game logs and screenshots stay
there, so they are named by path above and not attached.

Two traps for anyone reproducing it: --profile test forces HOS_HEADLESS=1, so use the default profile for the window;
and the Insert menu ignores keys and the gamepad unless its window is foreground, so a headless run cannot tap a tag at
all.

The checks, on the earlier head 1a4a6506546c: 963 checks, 18 skipped, 5 at once (linux) and
962 passed, 1 failed, 18 skipped in 419 s (linux, 5 at once). The one failure is tests/test_cpm_discovery.py, which
fails the same way on main (AssertionError: '/usr/local' is not None), and the 18 skips are main's own, id for id.
tests/test_nfc_model_info.py and tests/test_nfc_model_info_fields.py pass here and fail on main with 6 failed checks
each, all of them the swapped fields.

Still to test: None for the game or the checks: the suite at 9ef83d87f included the Windows compiler command parsing, and the empty-intersection rebase carries it to 01b1be9d1. No amiibo hardware was used: this function only reads the tag's model bytes, and a synthetic dump carries the same bytes a real tag does for it.

Measurements

Verdict: the bug reproduced on main and gone here; a fix's measurement is the failure and its absence.

Setup: Linux, NVIDIA GeForce RTX 4070 Ti, driver 0x9b124100; the windowed runtime of each side, the same 540-byte tag
file, tapped from Insert, the NFC tab, in Hyrule Field.

Before: main @ 8aa5ab87 After: this PR @ 1a4a6506
The Yunobo tag tapped in Hyrule Field "This amiibo is not supported." read, and the figure's items arrive
tests/test_nfc_model_info.py FAIL, 6 failed checks (field order) OK
tests/test_nfc_model_info_fields.py FAIL, 6 failed checks (field order) OK

The before side ran main at 8aa5ab87, the main main was at when the runs were made; host/nn_nfp.c is byte for
byte identical at 8aa5ab87 and at the pre-rebase base be663a08a3 (blob 9be1e3b89d, measured), and the two tests fail identically at both, so the
before row describes this base too.

Risks

The runtime change is the order of seven bytes in a 0x40-byte struct the game reads once per tag. A game or mod
that expected main's order would see the series and the figure's type swapped, which is the bug this fixes; nothing
else moves, and the rest of the struct is still zeroed. There is no switch: a revert is enough. Nothing changes on disk
after updating (no save, longshot_options.ini or cache), and a player notices only that figures other than the matching
one are accepted.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. — Rebased head 01b1be9d1 is directly on main @ 8f7300756701b7c9a278e576bb075ac20e622a32; the preserved diff is the single topic described in Summary: one HLE function and three checks.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. Windowed runs of both sides with the
    same synthetic tag.
  • mise run test passes on the rebased head by the empty-intersection evidence rule (any failure that also fails on main is named). Historical suite at 9ef83d87fe706db5d724930abcdcbbcbcc8cee1d: 834 passed, 2 failed, 8 skipped in 502 s (linux, 5 at once), exit 1; log prrefresh-logs/suite-2505-9ef83d87.log, sha256 40ed4e704a79defd3892b10e5b6247b1bcd8761405694fc3e9ed83a8b823ec73, .head = that sha, .start/.end/.exit and JUnit beside it. Passes against Amendment 1's CORE ∪ FLAKY plus the base failures of Amendment 2 — CORE/FLAKY: none; base-exempt: tests/test_display_startup_failure.py, tests/test_title_card_strips.py; same 8 skips. base failure tests/test_display_startup_failure.py exempt: fails identically at the merge-base be663a08a — display_startup_actual.inc:82:5: error: use of undeclared identifier 'bc_claim'; reproduction prrefresh-logs/base-be663a08a-two-ids.log, sha256 a26e89fa21110e64aa11987f7acae1a9d166b3c6e1877e8335aa3c9b0b9ac257. base failure tests/test_title_card_strips.py exempt: fails identically at the merge-base be663a08a — ModuleNotFoundError: No module named 'oot_patches'; same reproduction, same sha256. This is the second attempt under this ticket: the first (08:12) was voided by a foreign run_all.py from another lane's suite, and its log was overwritten. The pressure sampler did not cover the second attempt either — a stale .exit from the first made it stop after one sample — so guard evidence for it is absent; dev.py queue history shows no other suite started while it ran (only a 25 s longshot-builder build at 08:22), and the run reached its summary line with blocks agreeing.
  • Measured against main, or Measurements says why there is nothing to measure. For a fix: the refusal on main and
    its absence here, plus the test that fails on both.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible. The
    diff is host/nn_nfp.c, tests/test_nfc_model_info.py, tests/test_nfc_model_info_fields.py and one line of
    tests/test_host_guest_writes.py.

When it applies

  • A fix: a game-free test that fails on main and passes here. Both new and corrected checks fail on main's
    host/nn_nfp.c with the swapped fields and passed on the earlier tested head.
  • A check under tests/ that reads changed source is updated, not weakened. tests/test_host_guest_writes.py lists
    the bulk write it reads, now the 3-byte copy instead of the 7-byte one; tests/test_nfc_model_info.py gained per-field
    messages and now asserts the SDK's order rather than the tag's.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. The one changed host file cross-compiles for
    Windows with llvm-mingw 20261104 (the release tools.lock pins and .forgejo/workflows/build-windows.yml runs on its
    Linux runner): --target=x86_64-w64-mingw32, the host flags, a COFF-x86-64 object of 38,360 bytes, no warnings. On
    Linux the suite compiles the same function with -std=c11 -Wall -Wextra -Werror. The change adds no include, no
    platform call and no path, and it was not linked into a full Windows build.
  • Screenshots of the same spot on main and here, for a change that shows on screen. Hyrule Field, the same tag:
    /tmp/opencode/longshot-2489/runs/base-a-scan2.png shows the refusal, fix-e-scan3.png the items arriving; kept on the
    PC with the logs and named by path rather than attached.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers. The commit ends with
    Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go).

Ready to merge

  • Everything in Still to test has run, its results in Tested. — Merge gate: outstanding items remain in Still to test or are confirmed during review; this update does not tick it.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). — Merge gate: platform coverage is settled during review; this update does not claim new hardware coverage.
  • Approved in review, every comment answered. — Awaiting reviewer approval and resolution of any review comments.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold. — Awaiting CI on the current head; this update does not claim a CI run.
## Summary On `main`, a Zelda amiibo tapped in Hyrule Field is usually rejected: the game answers **"This amiibo is not supported."** for every figure except the one whose per-character amiibo settings happen to match. The tag keeps a figure's model as character, variant, figure type, model number, series (`0x54` to `0x5A`, in that order); `nn::nfp::ModelInfo` keeps it as character id, series, model number, figure type. `GetModelInfo` in `host/nn_nfp.c` copied the tag's seven bytes straight through, so the game read the figure's type as the series id and the series as the type, and only the matching figure was accepted. `GetModelInfo` now fills the SDK's order: the character id's three bytes copied, the series in `[3]`, the model's number as a native u16 in `[4..5]`, and the figure's type in `[6]`. Every figure whose tag says it belongs to a supported series is accepted. The NFC fixtures also use the shared compiler command parser to preserve Windows compiler paths. **To see the bug on `main`:** build `main`, put a 540-byte tag file in the NFC folder, run the game windowed, open Insert, the NFC tab, pick the tag, **Tap tag**, and walk into Hyrule Field so the game asks for a tag. `main` reads it (the log says `nfp: the game reads the NFC tag "..."`) and then answers "This amiibo is not supported." The same tag on this branch is read and its items arrive. Read first: `host/nn_nfp.c`, `GetModelInfo` (the four changed lines); then `tests/test_nfc_model_info_fields.py`, which is the two layouts written down. **The old test was wrong, and that is why `main` is green.** `tests/test_nfc_model_info.py` asserted the tag's own order — `memcmp(out, cases[i], 4)` and `out[6] == cases[i][6]` — so it agreed with the bug instead of the SDK and passed on `main` while the game rejected every other figure. It now asserts the SDK's order (`memcmp(out, cases[i], 3)`, `out[3] == cases[i][6]`, `out[6] == cases[i][3]`), and on `main` it fails with `FAIL case 0: ModelInfo 12 34 56 01 34 12 09, expected character 12 34 56, series 09, number 34 12, type 01`. The new `tests/test_nfc_model_info_fields.py` says the same thing from both sides: the tag's order in, the SDK's order out. Fixes #2489. **Rebase status (2026-11-25, current):** `9ef83d87f` → `01b1be9d1` onto `main @ 8f7300756701b7c9a278e576bb075ac20e622a32`. Stable patch-id `8ca929a67ccf1bd32058306a193779863dde1a0e` is unchanged and main's old-base→new-main file intersection with this PR is **empty**. The evidence already named below (suite, platform, in-game and measurement, as applicable) therefore still stands at the historical heads that produced it. Earlier rebase notes are history; where they say "this head", they mean the evidence commit named beside that run, not `01b1be9d1`. ## Testing **Rebase (2026-11-25).** Rebased onto `origin/main` `be663a08a30fa953420104d3cef6877bed6674a2`. The head this note starts from is `24b97e5f046152efa811f7d68900e9c84038d07c` (it had already moved from `1a4a650654` by the Windows-fixture commit `24b97e5f`, message and tests only), and the new head is `9ef83d87fe706db5d724930abcdcbbcbcc8cee1d`. `git diff -U0 6b928cb4d..24b97e5f` and `git diff -U0 be663a08a3..9ef83d87` hold the identical changed-line set (143 added/removed lines, 0 differing), so the rebase changed none of this PR's content. Main's new commits do touch `tests/test_host_guest_writes.py` (+7/−7, #2411), which this PR's NFC fixture work edits, so the checks below — already taken on the earlier head `1a4a650654` — are not re-established at this head. The `mise run test` box stays unticked pending a suite at `9ef83d87fe` after the quiet window; the Linux in-game runs and the Windows cross-compile describe `host/nn_nfp.c`, which main has not changed, and are kept as the record of those heads. **Tested:** Linux (kernel 7.3.5), NVIDIA GeForce RTX 4070 Ti, Vulkan 1.4, driver `0x9b124100`, windowed runs of the built runtime (not headless): a 540-byte synthetic Yunobo tag (a valid NTAG215 container, its model block at `0x54` reading `01 0c 00 00 a6 04 09`) in a temporary `LONGSHOT_NFC_DIR`, held to the reader from Insert, the NFC tab, then tapped in Hyrule Field. - This branch's tree (`v3.2.0-15-g9046a8d75-dirty`, built from `9046a8d75019` with the fix applied, before it was committed): the game reads the tag and the figure's items arrive. Log `/tmp/opencode/longshot-2489/runs/fix-e/log.txt`, screenshots `/tmp/opencode/longshot-2489/runs/fix-e-scan3.png` and `fix-e-scan2.png`. - `main` (`v3.2.0-12-g8aa5ab876`): the same tag is read and the game answers "This amiibo is not supported." Log `/tmp/opencode/longshot-2489/runs/base-a/log.txt`, screenshot `/tmp/opencode/longshot-2489/runs/base-a-scan2.png`. Both runs are windowed with 0 `vk: no window` lines. None of this leaves the PC: the game logs and screenshots stay there, so they are named by path above and not attached. Two traps for anyone reproducing it: `--profile test` forces `HOS_HEADLESS=1`, so use the default profile for the window; and the Insert menu ignores keys and the gamepad unless its window is foreground, so a headless run cannot tap a tag at all. The checks, on the earlier head `1a4a6506546c`: `963 checks, 18 skipped, 5 at once (linux)` and `962 passed, 1 failed, 18 skipped in 419 s (linux, 5 at once)`. The one failure is `tests/test_cpm_discovery.py`, which fails the same way on `main` (`AssertionError: '/usr/local' is not None`), and the 18 skips are `main`'s own, id for id. `tests/test_nfc_model_info.py` and `tests/test_nfc_model_info_fields.py` pass here and fail on `main` with 6 failed checks each, all of them the swapped fields. **Still to test:** None for the game or the checks: the suite at `9ef83d87f` included the Windows compiler command parsing, and the empty-intersection rebase carries it to `01b1be9d1`. No amiibo hardware was used: this function only reads the tag's model bytes, and a synthetic dump carries the same bytes a real tag does for it. ## Measurements **Verdict:** the bug reproduced on `main` and gone here; a fix's measurement is the failure and its absence. Setup: Linux, NVIDIA GeForce RTX 4070 Ti, driver `0x9b124100`; the windowed runtime of each side, the same 540-byte tag file, tapped from Insert, the NFC tab, in Hyrule Field. | | Before: main @ 8aa5ab87 | After: this PR @ 1a4a6506 | |---|---|---| | The Yunobo tag tapped in Hyrule Field | "This amiibo is not supported." | read, and the figure's items arrive | | `tests/test_nfc_model_info.py` | FAIL, 6 failed checks (field order) | OK | | `tests/test_nfc_model_info_fields.py` | FAIL, 6 failed checks (field order) | OK | The before side ran `main` at `8aa5ab87`, the main `main` was at when the runs were made; `host/nn_nfp.c` is byte for byte identical at `8aa5ab87` and at the pre-rebase base `be663a08a3` (blob `9be1e3b89d`, measured), and the two tests fail identically at both, so the before row describes this base too. ## Risks The runtime change is the order of seven bytes in a 0x40-byte struct the game reads once per tag. A game or mod that expected `main`'s order would see the series and the figure's type swapped, which is the bug this fixes; nothing else moves, and the rest of the struct is still zeroed. There is no switch: a revert is enough. Nothing changes on disk after updating (no save, `longshot_options.ini` or cache), and a player notices only that figures other than the matching one are accepted. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. — Rebased head `01b1be9d1` is directly on `main @ 8f7300756701b7c9a278e576bb075ac20e622a32`; the preserved diff is the single topic described in Summary: one HLE function and three checks. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. Windowed runs of both sides with the same synthetic tag. - [x] `mise run test` passes on the rebased head by the empty-intersection evidence rule (any failure that also fails on `main` is named). **Historical suite at `9ef83d87fe706db5d724930abcdcbbcbcc8cee1d`: 834 passed, 2 failed, 8 skipped in 502 s (linux, 5 at once), exit 1; log `prrefresh-logs/suite-2505-9ef83d87.log`, sha256 `40ed4e704a79defd3892b10e5b6247b1bcd8761405694fc3e9ed83a8b823ec73`, `.head` = that sha, `.start`/`.end`/`.exit` and JUnit beside it.** Passes against Amendment 1's CORE ∪ FLAKY plus the base failures of Amendment 2 — CORE/FLAKY: none; base-exempt: `tests/test_display_startup_failure.py`, `tests/test_title_card_strips.py`; same 8 skips. base failure `tests/test_display_startup_failure.py` exempt: fails identically at the merge-base `be663a08a` — `display_startup_actual.inc:82:5: error: use of undeclared identifier 'bc_claim'`; reproduction `prrefresh-logs/base-be663a08a-two-ids.log`, sha256 `a26e89fa21110e64aa11987f7acae1a9d166b3c6e1877e8335aa3c9b0b9ac257`. base failure `tests/test_title_card_strips.py` exempt: fails identically at the merge-base `be663a08a` — `ModuleNotFoundError: No module named 'oot_patches'`; same reproduction, same sha256. This is the second attempt under this ticket: the first (08:12) was voided by a foreign `run_all.py` from another lane's suite, and its log was overwritten. The pressure sampler did not cover the second attempt either — a stale `.exit` from the first made it stop after one sample — so guard evidence for it is absent; `dev.py queue history` shows no other suite started while it ran (only a 25 s `longshot-builder` build at 08:22), and the run reached its summary line with blocks agreeing. - [x] Measured against `main`, or Measurements says why there is nothing to measure. For a fix: the refusal on `main` and its absence here, plus the test that fails on both. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. The diff is `host/nn_nfp.c`, `tests/test_nfc_model_info.py`, `tests/test_nfc_model_info_fields.py` and one line of `tests/test_host_guest_writes.py`. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. Both new and corrected checks fail on `main`'s `host/nn_nfp.c` with the swapped fields and passed on the earlier tested head. - [x] A check under `tests/` that reads changed source is updated, not weakened. `tests/test_host_guest_writes.py` lists the bulk write it reads, now the 3-byte copy instead of the 7-byte one; `tests/test_nfc_model_info.py` gained per-field messages and now asserts the SDK's order rather than the tag's. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. The one changed host file cross-compiles for Windows with llvm-mingw 20261104 (the release `tools.lock` pins and `.forgejo/workflows/build-windows.yml` runs on its Linux runner): `--target=x86_64-w64-mingw32`, the host flags, a COFF-x86-64 object of 38,360 bytes, no warnings. On Linux the suite compiles the same function with `-std=c11 -Wall -Wextra -Werror`. The change adds no include, no platform call and no path, and it was not linked into a full Windows build. - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. Hyrule Field, the same tag: `/tmp/opencode/longshot-2489/runs/base-a-scan2.png` shows the refusal, `fix-e-scan3.png` the items arriving; kept on the PC with the logs and named by path rather than attached. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. The commit ends with `Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)`. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. — Merge gate: outstanding items remain in Still to test or are confirmed during review; this update does not tick it. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). — Merge gate: platform coverage is settled during review; this update does not claim new hardware coverage. - [ ] Approved in review, every comment answered. — Awaiting reviewer approval and resolution of any review comments. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. — Awaiting CI on the current head; this update does not claim a CI run.
fix(nfc): put the amiibo model fields in the SDK's order (#2489)
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
1a4a650654
GetModelInfo copied the tag's model block at 0x54 in tag order, so
ModelInfo[3] held the figure's type and ModelInfo[6] the series. The game
read the type as the series id: only the per-character amiibo settings
matched, and every other Zelda figure was rejected as not supported.

Return the SDK's layout: the character id (three bytes), the series, the
model's number as a native u16, and the figure's type.

tests/test_nfc_model_info.py now asserts that order. The new
tests/test_nfc_model_info_fields.py reproduces the rejection's cause with
synthetic tag blocks whose type and series differ: the tag's order in, the
SDK's order out. Both fail on main for the field swap and pass with the
fix.

Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)
Author
Contributor

Tested in game: Linux, NVIDIA GeForce RTX 4070 Ti, Vulkan 1.4, driver 0x9b124100, windowed run (not headless), Hyrule Field: a 540-byte synthetic Yunobo tag tapped from Insert, the NFC tab, is read on this branch and the figure's items arrive; the same tag on main (v3.2.0-12-g8aa5ab876) is read and the game answers "This amiibo is not supported." The logs and screenshots stay on the PC (the no-game-material rule), so they are named by path in the description rather than attached.

Tested in game: Linux, NVIDIA GeForce RTX 4070 Ti, Vulkan 1.4, driver 0x9b124100, windowed run (not headless), Hyrule Field: a 540-byte synthetic Yunobo tag tapped from Insert, the NFC tab, is read on this branch and the figure's items arrive; the same tag on main (v3.2.0-12-g8aa5ab876) is read and the game answers "This amiibo is not supported." The logs and screenshots stay on the PC (the no-game-material rule), so they are named by path in the description rather than attached.
Member
@review
BeanBot left a comment

Recommendation: Approve. The field mapping fixes the reproduced rejection, but the new test mishandles a normal Windows compiler path supplied through CC. The remaining CI checks also need to finish. Nothing blocking is left. Recommend approval; not approved on the forge.

GetModelInfo returns the tag’s series and figure type in the SDK’s field order. The reported Linux game run shows the previously rejected synthetic tag working; the new test duplicates much of the existing fixture.

Should fix (1): not blocking, but worth doing before merging.

  • L1 tests/test_nfc_model_info_fields.py:101: The new test parses CC with POSIX shell rules on Windows, which removes backslashes from an unquoted Windows compiler path. (more on the line) Do: Parse CC in a platform-aware way that preserves Windows paths and compiler arguments, and apply the same correction to the existing NFC fixture if sharing the helper.

@fix can do L1.

Checks: Still running: 9 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes. The reported same-tag game runs rejected the tag on main and delivered its items with the fix. The author also reports both field-order tests failing on the base and passing with the fix.

Other systems: Both file-backed tags and the Windows controller reader populate the same locked tag buffer, so both use the corrected mapping. The change does not touch rendering, saves, audio, input timing, or GPU-specific code. The author reports a Windows cross-compilation of the host file but no full Windows build or game run.

Switches: None added, changed, or removed.

Reviewed: 1a4a650654 against 9046a8d750: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the commit and diff, and the changed test files. Read the changed NFC function and surrounding tag-loading, locking, and reader paths; skimmed the remainder of host/nn_nfp.c. The named local run artifacts were not available for inspection. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review).

Checked and fine:

  • The changed tag reads remain under the shared NFC lock; tag writers use the exclusive lock.
  • The changed offsets stay within the fixed 540-byte tag buffer and the 0x40-byte output.
  • The commit includes the required AI-assistance trailer; no generated files, game files, API versions, or switch-table entries change.
  • The corrected existing test exercises the swapped fields, output guards, unmounted states, and unchanged tag contents.

Testing: Read-only review; no code, scripts, builds, or tests were run. The supplied CI status lists checks still running and no head-only failures.

Overlaps and merge order: Not checked; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The field mapping fixes the reproduced rejection, but the new test mishandles a normal Windows compiler path supplied through CC. The remaining CI checks also need to finish. Nothing blocking is left. Recommend approval; not approved on the forge. GetModelInfo returns the tag’s series and figure type in the SDK’s field order. The reported Linux game run shows the previously rejected synthetic tag working; the new test duplicates much of the existing fixture. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `tests/test_nfc_model_info_fields.py:101`: The new test parses CC with POSIX shell rules on Windows, which removes backslashes from an unquoted Windows compiler path. (more on the line) **Do:** Parse CC in a platform-aware way that preserves Windows paths and compiler arguments, and apply the same correction to the existing NFC fixture if sharing the helper. `@fix` can do L1. **Checks:** Still running: 9 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The reported same-tag game runs rejected the tag on main and delivered its items with the fix. The author also reports both field-order tests failing on the base and passing with the fix. **Other systems:** Both file-backed tags and the Windows controller reader populate the same locked tag buffer, so both use the corrected mapping. The change does not touch rendering, saves, audio, input timing, or GPU-specific code. The author reports a Windows cross-compilation of the host file but no full Windows build or game run. **Switches:** None added, changed, or removed. **Reviewed:** 1a4a6506546c against 9046a8d75019: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the commit and diff, and the changed test files. Read the changed NFC function and surrounding tag-loading, locking, and reader paths; skimmed the remainder of host/nn_nfp.c. The named local run artifacts were not available for inspection. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review). **Checked and fine:** - The changed tag reads remain under the shared NFC lock; tag writers use the exclusive lock. - The changed offsets stay within the fixed 540-byte tag buffer and the 0x40-byte output. - The commit includes the required AI-assistance trailer; no generated files, game files, API versions, or switch-table entries change. - The corrected existing test exercises the swapped fields, output guards, unmounted states, and unchanged tag contents. **Testing:** Read-only review; no code, scripts, builds, or tests were run. The supplied CI status lists checks still running and no head-only failures. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -0,0 +98,4 @@
class NfcModelInfoFields(unittest.TestCase):
def test_each_field_lands_where_the_sdk_puts_it(self):
Member

L1 (should fix): The new test parses CC with POSIX shell rules on Windows, which removes backslashes from an unquoted Windows compiler path.

When: With CC set to a path such as C:\llvm\bin\clang.exe, shlex.split produces C:llvmbinclang.exe. subprocess.run then cannot find the compiler, so this new check errors on a supported platform.

Do: Parse CC in a platform-aware way that preserves Windows paths and compiler arguments, and apply the same correction to the existing NFC fixture if sharing the helper.

**L1** (should fix): The new test parses CC with POSIX shell rules on Windows, which removes backslashes from an unquoted Windows compiler path. *When:* With CC set to a path such as C:\llvm\bin\clang.exe, shlex.split produces C:llvmbinclang.exe. subprocess.run then cannot find the compiler, so this new check errors on a supported platform. **Do:** Parse CC in a platform-aware way that preserves Windows paths and compiler arguments, and apply the same correction to the existing NFC fixture if sharing the helper.
Member
@fix
BeanBot force-pushed fix/nfp-model-info-field-order from 1a4a650654
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 24b97e5f04
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 7s
CI / Conventional Commit title (pull_request) Successful in 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 13s
Website / Website builds (pull_request) Successful in 1m34s
CI / Website build and checks (pull_request) Successful in 1m34s
2026-11-25 05:33:30 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The compiler parsing fix preserves Windows paths in both NFC fixtures while keeping their existing compiler fallback. The recorded game run shows the NFC field-order fix working for the tested tag. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 24b97e5f04. I rebased it onto main (6b928cb4dc). I edited its description to match the change.

Changed

  • Windows CC parsing in NFC fixtures: Both tests use the shared platform-aware compiler parser at tests/test_nfc_model_info_fields.py:102 and tests/test_nfc_model_info.py:102. Tests were not run, as requested.

Nothing was built or run: the checks run again on the new head.

The runtime change puts amiibo model fields in the order the game expects; the fixture change makes configured Windows compiler paths usable. The fix reuses the suite's shared parser without disabling the NFC tests.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (4; not asked for, not blocking)
  • CI has not yet run on the new head.
  • The reported Windows check compiled the changed host file but did not link a full Windows build.
  • The base-to-head diff includes changes outside the four files listed in the pull request description.
  • The checks on the final head have not yet run.
More: does it help, other systems, switches, what was read

Does it help: Yes. The author reports that the same synthetic Yunobo tag was rejected on main and produced items with the fix in a windowed Linux game run. No performance gain is claimed.

Other systems: The runtime field mapping is shared across platforms. The reported game run was on Linux; the changed host file was also reported to cross-compile for Windows. The parser selects Windows argument rules on Windows and shell parsing elsewhere.

Switches: None added, changed, or removed.

Reviewed: 24b97e5f04 against 6b928cb4dc: Read AGENTS.md, CONTRIBUTING.md, the pull request template, both NFC fixtures, the shared compiler parser, the fix diff, and the GetModelInfo implementation. The full base diff includes additional unrelated changes and was skimmed, not reviewed in full; docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • Both NFC fixtures use the shared parser before choosing their existing compiler fallback.
  • The parser change leaves the runtime fix and fixture assertions intact.
  • The model output remains zero-initialized and is written under the existing shared lock.

Testing: No commands from the project were run. The author reports a windowed before-and-after game run and passing NFC fixtures on the earlier head; CI has not run on the final head.

Overlaps and merge order: Unknown; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The compiler parsing fix preserves Windows paths in both NFC fixtures while keeping their existing compiler fallback. The recorded game run shows the NFC field-order fix working for the tested tag. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 24b97e5f0461. I rebased it onto `main` (6b928cb4dcdc). I edited its description to match the change. **Changed** - **Windows CC parsing in NFC fixtures**: Both tests use the shared platform-aware compiler parser at tests/test_nfc_model_info_fields.py:102 and tests/test_nfc_model_info.py:102. Tests were not run, as requested. Nothing was built or run: the checks run again on the new head. The runtime change puts amiibo model fields in the order the game expects; the fixture change makes configured Windows compiler paths usable. The fix reuses the suite's shared parser without disabling the NFC tests. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (4; not asked for, not blocking)</summary> - CI has not yet run on the new head. - The reported Windows check compiled the changed host file but did not link a full Windows build. - The base-to-head diff includes changes outside the four files listed in the pull request description. - The checks on the final head have not yet run. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports that the same synthetic Yunobo tag was rejected on main and produced items with the fix in a windowed Linux game run. No performance gain is claimed. **Other systems:** The runtime field mapping is shared across platforms. The reported game run was on Linux; the changed host file was also reported to cross-compile for Windows. The parser selects Windows argument rules on Windows and shell parsing elsewhere. **Switches:** None added, changed, or removed. **Reviewed:** 24b97e5f0461 against 6b928cb4dcdc: Read AGENTS.md, CONTRIBUTING.md, the pull request template, both NFC fixtures, the shared compiler parser, the fix diff, and the GetModelInfo implementation. The full base diff includes additional unrelated changes and was skimmed, not reviewed in full; docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - Both NFC fixtures use the shared parser before choosing their existing compiler fallback. - The parser change leaves the runtime fix and fixture assertions intact. - The model output remains zero-initialized and is written under the existing shared lock. **Testing:** No commands from the project were run. The author reports a windowed before-and-after game run and passing NFC fixtures on the earlier head; CI has not run on the final head. **Overlaps and merge order:** Unknown; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
dazemc force-pushed fix/nfp-model-info-field-order from 24b97e5f04
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 7s
CI / Conventional Commit title (pull_request) Successful in 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 13s
Website / Website builds (pull_request) Successful in 1m34s
CI / Website build and checks (pull_request) Successful in 1m34s
to 9ef83d87fe
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 22s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-25 09:03:54 +00:00
Compare
dazemc force-pushed fix/nfp-model-info-field-order from 9ef83d87fe
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 22s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 01b1be9d16
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 14s
2026-11-25 17:55:02 +00:00
Compare
Author
Contributor

Rebased 9ef83d87f to 01b1be9d1 on main 8f7300756; patch-id unchanged and intersection empty. Existing suite, game and Windows evidence stands; stale final-head wording corrected.

Rebased 9ef83d87f to 01b1be9d1 on main 8f7300756; patch-id unchanged and intersection empty. Existing suite, game and Windows evidence stands; stale final-head wording corrected.
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 14s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/nfp-model-info-field-order:dazemc-fix/nfp-model-info-field-order'
git switch 'dazemc-fix/nfp-model-info-field-order'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2505
No description provided.