Training neural networks on Apple Neural Engine via reverse-engineered private APIs
This report summarizes scanner evidence for maderix/ANE, a Objective-C project with 7,261 GitHub stars. SynthScan examined 14,302 lines of code across 54 source files, recording 72 pattern matches distributed across 9 syntactic categories. The legacy adjusted pattern signal is 8.3 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 58 finding(s).
Are imports declared and package/API names verified? 1 finding(s).
Are wrappers, guards, and repeated structures necessary? 15 finding(s).
Which changes need focused human review? 72 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 72 distinct pattern matches across 9 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ane_int8_bench.m | 1 | // ane_int8_bench.m — INT8 W8A8 benchmark on ANE via _ANEInMemoryModel | COMMENT |
| LOW | bridge/ane_bridge.h | 1 | // ane_bridge.h — C-callable bridge to ANE private APIs for Python ctypes | COMMENT |
| LOW | bridge/ane_bridge.h | 21 | COMMENT | |
| LOW | training/train_large.m | 561 | io_copy(kern[L].qkvBwd->ioIn, 0, sdpaBwd2[L]->ioOut, 0, 2*DIM, SEQ); | COMMENT |
| LOW | training/train_large.m | 581 | // Wait no - dx2 = d(loss)/d(x2), not d(loss)/d(layer_input) | COMMENT |
| LOW | training/ane_classifier.h | 1 | // ane_classifier.h — MIL generators for classifier matmul and softmax on ANE | COMMENT |
| LOW | training/test_conv_attn3.m | 1 | // Grouped conv causal attention with CORRECT layout A: blob[oc*ICg + ic] | COMMENT |
| LOW | training/test_weight_reload.m | 1 | // test_weight_reload.m — Can we skip recompilation by rewriting weight blobs on disk? | COMMENT |
| LOW | training/tiny_train_old.m | 1 | // tiny_train.m — Train a 2-layer linear model on ANE (forward AND backward) | COMMENT |
| LOW | training/test_dynamic_matmul.m | 1 | // test_dynamic_matmul.m — Benchmark dynamic matmul on ANE (no recompile) | COMMENT |
| LOW | training/test_weight_patch.m | 1 | // test_weight_patch.m — Test whether ANE weights can be patched after compile | COMMENT |
| LOW | training/ane_rmsnorm_bwd.h | 1 | // ane_rmsnorm_bwd.h — MIL generator for RMSNorm backward on ANE | COMMENT |
| LOW | training/stories_config.h | 1 | // stories_config.h — Stories110M model config and structures | COMMENT |
| LOW | training/stories_config.h | 21 | #define HD (DIM/HEADS) | COMMENT |
| LOW | training/train_large_ane.m | 1 | // train_large_ane.m — Stories110M training with CPU ops offloaded to ANE | COMMENT |
| LOW | training/test_fused_qkv.m | 1 | // Test: Fused QKV projections in single MIL graph (3 convs → concat output) | COMMENT |
| LOW | training/model.h | 1 | // model.h — Stories110M model struct + weight loading + ANE kernel compilation | COMMENT |
| LOW | training/tiny_train.m | 1 | // tiny_train.m — Train a 2-layer linear model on ANE (forward AND backward) | COMMENT |
| LOW | training/test_fused_bwd.m | 1 | // Test: fused backward dx kernels | COMMENT |
| LOW | training/test_full_fused.m | 1 | // Full fused forward: QKV convs → reshape → matmul(Q,K^T) → scale+mask → softmax → matmul(scores,V) → Wo conv | COMMENT |
| LOW | training/test_ane_causal_attn.m | 1 | // Decomposed causal attention: Q@K^T on ANE, mask+softmax on CPU, scores@V on ANE | COMMENT |
| LOW | training/training_dynamic/config.h | 1 | // config.h — Model-agnostic structs, derived sizes, ANE init | COMMENT |
| LOW | training/training_dynamic/config.h | 21 | #ifndef MODEL_NAME | COMMENT |
| LOW | training/training_dynamic/models/stories110m.h | 1 | // stories110m.h — Stories110M (Llama2-style, 12 layers, MHA) | COMMENT |
| LOW | training/training_dynamic/models/qwen3_06b.h | 1 | // qwen3_06b.h — Qwen3-0.6B (28 layers, GQA 16q/8kv, head_dim=128) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | training/dashboard.py | 375 | except ValueError: | CODE |
| HIGH | training/dashboard.py | 462 | except (json.JSONDecodeError, KeyError): | CODE |
| HIGH | training/dashboard.py | 334 | except (psutil.NoSuchProcess, psutil.AccessDenied): | CODE |
| HIGH | training/dashboard.py | 1044 | except Exception: | CODE |
| HIGH | training/dashboard.py | 1103 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | training/test_conv_attn3.m | 177 | // Step 1: Q@K^T | COMMENT |
| LOW⚡ | training/test_conv_attn3.m | 181 | // Step 2: Scale + causal mask + softmax (CPU) | COMMENT |
| LOW | training/test_conv_attn3.m | 202 | // Step 3: scores@V | COMMENT |
| LOW | training/ane_rmsnorm_bwd.h | 35 | // Step 1: Compute rrms = 1/sqrt(mean(x²) + eps) | COMMENT |
| LOW⚡ | training/ane_rmsnorm_bwd.h | 51 | // Step 2: Load RMSNorm weights w [1, DIM, 1, 1] | COMMENT |
| LOW⚡ | training/ane_rmsnorm_bwd.h | 54 | // Step 3: Compute dot = sum(dy * w * x, axis=1) * invd * rrms² | COMMENT |
| LOW | training/ane_rmsnorm_bwd.h | 68 | // Step 4: dx = (dy * w - x * coeff) * rrms | COMMENT |
| LOW | training/test_ane_causal_attn.m | 97 | // Step 1: Q @ K^T → scores [1, HEADS, SEQ, SEQ] | COMMENT |
| LOW | training/test_ane_causal_attn.m | 115 | // Step 3: scores_softmax @ V → output [1, HEADS, SEQ, HD] | COMMENT |
| LOW⚡ | training/test_ane_causal_attn.m | 167 | // Step 1: Q@K^T on ANE | COMMENT |
| LOW⚡ | training/test_ane_causal_attn.m | 173 | // Step 2: Scale + causal mask + softmax on CPU | COMMENT |
| LOW | training/test_ane_causal_attn.m | 197 | // Step 3: softmax_scores @ V on ANE | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | training/test_conv_attn3.m | 177 | // Step 1: Q@K^T | COMMENT |
| LOW⚡ | training/test_conv_attn3.m | 181 | // Step 2: Scale + causal mask + softmax (CPU) | COMMENT |
| LOW | training/test_conv_attn3.m | 202 | // Step 3: scores@V | COMMENT |
| LOW | training/ane_rmsnorm_bwd.h | 35 | // Step 1: Compute rrms = 1/sqrt(mean(x²) + eps) | COMMENT |
| LOW⚡ | training/ane_rmsnorm_bwd.h | 51 | // Step 2: Load RMSNorm weights w [1, DIM, 1, 1] | COMMENT |
| LOW⚡ | training/ane_rmsnorm_bwd.h | 54 | // Step 3: Compute dot = sum(dy * w * x, axis=1) * invd * rrms² | COMMENT |
| LOW | training/ane_rmsnorm_bwd.h | 68 | // Step 4: dx = (dy * w - x * coeff) * rrms | COMMENT |
| LOW | training/test_ane_causal_attn.m | 97 | // Step 1: Q @ K^T → scores [1, HEADS, SEQ, SEQ] | COMMENT |
| LOW | training/test_ane_causal_attn.m | 115 | // Step 3: scores_softmax @ V → output [1, HEADS, SEQ, HD] | COMMENT |
| LOW⚡ | training/test_ane_causal_attn.m | 167 | // Step 1: Q@K^T on ANE | COMMENT |
| LOW⚡ | training/test_ane_causal_attn.m | 173 | // Step 2: Scale + causal mask + softmax on CPU | COMMENT |
| LOW | training/test_ane_causal_attn.m | 197 | // Step 3: softmax_scores @ V on ANE | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | training/dashboard.py | 141 | def load_weights_from_ckpt(path): | CODE |
| MEDIUM | training/dashboard.py | 1173 | def force_gen(): | CODE |
| LOW | training/dashboard.py | 135 | except Exception as e: | CODE |
| LOW | training/dashboard.py | 172 | except Exception as e: | CODE |
| LOW | training/dashboard.py | 313 | except Exception as e: | CODE |
| LOW | training/dashboard.py | 1044 | except Exception: | CODE |
| LOW | training/dashboard.py | 1103 | except Exception: | CODE |
| LOW | training/dashboard.py | 1182 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | training/dashboard.py | 186 | CODE | |
| LOW | training/dashboard.py | 290 | CODE | |
| LOW | training/dashboard.py | 418 | CODE | |
| LOW | training/dashboard.py | 590 | CODE | |
| LOW | training/dashboard.py | 651 | CODE | |
| LOW | training/dashboard.py | 947 | CODE | |
| LOW | training/tokenize.py | 12 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | training/dashboard.py | 910 | cmd = f'cd training_dynamic && make{model_arg} 2>&1 && ./train' | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | training/dashboard.py | 394 | def _sync_globals_from_parsed(cfg): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | training/dashboard.py | 906 | CODE |