問題:同一顆含 Softmax 的 tflite,正式站能編出 KL520 真 .nef, 本專案 worker 在 nef 階段撞 UnimplementedFeature [Softmax] exit 6。 根因:runtime ktc 的 eliminate_tail 是 no-op(閹割版、只印警告), 尾端 Softmax 未被移除;正式站產物實測為 logits 輸出(Softmax 已砍)。 修法(staging 實測驗證、與正式站產物權重段逐 byte 相同): - onnx/core.py:新增 remove_tail_softmax(),onnx2onnx_flow 後對所有 platform 移除 terminal Softmax(cut_nodes、不用 cut_types 避免誤砍 中間層下游)、多 output rewire 逐項驗證 fail-loud、onnx.checker、 removed_tail_softmax metadata - precheck.py:R3 誤擋收窄——刪 hw_not_support_col 欄位名誤命中、 op capture 改必須、抽不到具體 op 名改放行+warning(真 fail-open)、 刪自由文字猜 op fallback、加噪音 token 過濾 - tests:+16(29 passed;terminal/no-op/多 output/fail-open 全覆蓋) - docs:TDD §12、design-doc ADR-012、PRD 輸出語意變更(機率→logits) 行為變更:所有 platform NEF 輸出改 logits(與正式站一致)、 分類後處理需呼叫端自行補 softmax。 Review:兩輪(0C/3M→0C/0M);W3 docker integration 6/6 PASS (520+Softmax e2e 產真 .nef 799,844 bytes、720 回歸、precheck 放行)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Test Run Instructions
From the repository root, run:
pytest tests/workers
If you only want one worker's core tests:
pytest tests/workers/test_onnx_core.py
pytest tests/workers/test_bie_core.py
pytest tests/workers/test_nef_core.py
Input Files
These tests run the real KTC flow. You must provide input files.
Place them under tests/fixtures as follows:
tests/fixtures/
onnx/
input.onnx # Required for ONNX and BIE tests
bie_images/
image1.jpg # Required for BIE test (at least 1 image)
bie/
input.bie # Required for NEF test
outputs/
(test outputs will be written here)
Notes:
tests/fixtures/onnx/input.onnxshould be a valid ONNX model.tests/fixtures/bie_images/should contain at least one image file.tests/fixtures/bie/input.bieshould be a valid BIE file.- Outputs are written to
tests/fixtures/outputs/and are required for the tests.