Diana 0.10: Forty-Five Counted Changes and the Attempts That Lost
Diana 0.10 removed 34.6 percent of detect instructions and 24.3 percent of tracker instructions through forty-five counted changes. The refuted attempts stay on record.

How did Diana 0.10 cut its instruction count?
Diana 0.10 kept forty-five changes across fifteen veins, each required to remove more than 100,000 instructions under callgrind. One yolo26n detect fell from 1,075,156,773 to 702,792,245 instructions and a tracker replay from 21,336,089 to 16,148,683. Wall clock was not re-measured.
Diana 0.10 is an instruction-count campaign on the FFAI detector and tracker, and its ledger is more interesting than its headline. Forty-five changes across fifteen veins survived a keep rule of more than 100,000 instructions each. One yolo26n detect went from 1,075,156,773 to 702,792,245 instructions, down 34.6 percent. One tracker replay went from 21,336,089 to 16,148,683, down 24.3 percent. A list of attempts that made things worse is kept beside the wins.
The campaign commit is e119f1a9, with baseline tag ffai-diana-v0.9.0 as its parent. It shipped as 0.10.0 and is unchanged inside the current crates.io release, ffai-diana 0.11.0. Diana 0.10 did not rerun the wall clock. The README says the older timing tables predate it. This note does not convert instructions into milliseconds.
The builder introduction is Diana, and the suite note is FFAI. The comparison page against C detection stacks is Pure Rust Alternative for YOLO C stacks. Every number here is repository-reported. Nothing was rerun for this article.
What the Diana 0.10 ledger measures
The command is wsl bash tools/diana_ir.sh LABEL detect|track. The build is cargo build --release -p ffai-diana for the ir_detect and ir_track examples, with line-tables-only debug info. The run uses taskset -c 2, FFAI_DIANA_THREADS=1 and RAYON_NUM_THREADS=1, with callgrind collection toggled on the instrumented region. Named versions: rustc 1.95.0, valgrind 3.26.0. The CPU model is not named.
Detect input is yolo26n, rect geometry, on one COCO val2017 image, 000000000785.jpg. Track input is cached MOT17-02 detections. Anchors held across the run: an FNV hash over byte-identical steps, MAC and im2col counters, and for tracking reported=3608, max_id=38 and a fixed FNV value.
The noise floor is what makes the keep rule meaningful. Same-binary detect reruns spread by at most about 10K instructions, tracking by zero. A 100,000-instruction threshold is roughly ten times the detect spread, so a kept vein is decidable on a single pair of runs. On a roughly billion-instruction detect that is about 0.01 percent, far below what a noisy wall clock can resolve.
Raw callgrind files live under ~/ffai-ir on the measuring machine, outside git. tools/diana_ir_audit.py re-derives the table from that external ledger. The committed diana-ir-veins.md is a transcription.
The Diana 0.10 veins that paid
The largest mechanisms, grouped by where they live in the graph.
im2col, GEMM, and writing into the concat buffer in Diana 0.10
im2col rows are copied with memcpy. GEMM is called directly into uninitialized output, so the zero-fill disappears. SPPF max-pool writes straight into the concat buffer (maxpool.rs), and GEMM outputs land in their C3k2 and C3k concat slots. Upsample plus concat runs as one pass. Residual additions fold into the epilogue of the convolution that produced them. The common thread is fewer passes over activation buffers.
Depthwise, head, and letterbox kernels
The depthwise 3x3 now fuses bias and SiLU with an 8-wide stencil (dwconv.rs). That fusion is why depthwise3x3 gained an act argument. Head 1x1 convolutions run as matmul (cpuop.rs). Letterboxing is a two-pass bilinear resample with a byte lookup. Attention transposes became strided GEMM views. A direct kernel serves the 3-channel stem.
The Diana 0.10 tracker cost matrix
Tracking follows ByteTrack. The cost matrix is now flat, and the transposed Hungarian solve swaps indices instead of materializing a transpose (assign.rs). That is the 24.3 percent tracker cut. Public callers keep the nested-vector API through wrappers.
What Diana 0.10 refused to claim
The refuted list and the caveats are the part worth copying into your own campaigns.
The Diana 0.10 refuted list
Several counted attempts raised the instruction count and were reverted or excluded: a scalar fused softmax, an inline 8-float im2col in place of memcpy, Winograd at MIN_CHANNELS=32 before the structure-of-arrays rewrite, AVX2 Winograd transforms, and a first stem kernel that spilled. The ledger keeps their numbers. They are not wins, and the order matters: Winograd lost before the data layout changed, and the Winograd path that ships today came after that rewrite.
Winograd, fast exp, and the oracle
Two numeric defaults leave bit identity. Winograd F(2x2, 3x3), from Lavin and Gray, applies when both channel counts are at least 16 (MIN_CHANNELS). Attention softmax uses a polynomial exp. FFAI_DIANA_NO_WINOGRAD=1 and FFAI_DIANA_SOFTMAX_LIBM=1 restore GEMM and libm. The full-graph oracle passes on tiers n, s, m, l and x, worst sampled relative delta 1.120e-5 on m against a pre-existing margin of 4.8e-5. Box deltas run larger than class deltas. Determinism 2/2, lib tests 86/86, depth oracle pass.
No clock, no allocator credit for Diana 0.10
Callgrind is blind to cache misses, page faults, branch mispredicts and rayon barriers, and the plan says so. The older p50 and ONNX Runtime comparisons predate 0.10 and belong to the introduction. The 0.11.0 bump adds rusty_alloc 2.4.0, and its 4.2 percent figure is the allocator's own benchmark. FFAI's allocator A/B was not re-run, so none of it is a Diana result. See rusty_alloc for that crate, the repo landing at Diana, and the cluster at Mind.
FAQ
Quick answers for builders evaluating this technology.
Which Diana 0.10 attempts were reverted?
The ledger lists attempts that raised the count: a scalar fused softmax, an inline 8-float im2col instead of memcpy, Winograd at MIN_CHANNELS=32 before the structure-of-arrays rewrite, AVX2 Winograd transforms, and a first stem kernel that spilled registers.
Where does Diana 0.10 stop being bit-identical?
Winograd F(2x2, 3x3) on 3x3 stride-1 convolutions with at least 16 channels, and a polynomial exp in attention softmax. Both are on by default. FFAI_DIANA_NO_WINOGRAD=1 and FFAI_DIANA_SOFTMAX_LIBM=1 restore the old arithmetic.
Is Diana 0.10 a breaking release?
For one function. dwconv::depthwise3x3 gained an act argument, so direct callers must update. The tracker's public nested-vector API was kept as wrappers around the new flat cost matrix.
What can callgrind not see in the Diana 0.10 numbers?
Cache misses, page faults, branch mispredicts and rayon thread barriers. The plan says the campaign does not claim those, which is why the instruction cut is not presented as a latency cut.
Which published crate contains the Diana 0.10 campaign?
ffai-diana 0.11.0 on crates.io contains campaign commit e119f1a9 unchanged. 0.11.0 adds a rusty_alloc 2.4.0 pin whose 4.2 percent figure is the allocator's own benchmark, not a Diana measurement.