Repository navigation
RiverFlow 0.11 · Native optimiser
RF2 now performs guarded native optimisation in its own ARM64 compiler.
Register-resident locals, direct arithmetic, loop rotation, restricted expression coalescing and guarded word selection reduce ordinary instruction overhead. An exact periodic masked-sum recurrence can become fixed-size arithmetic, with ordinary-loop fallbacks. Modules, records and all nine bounded MCP tools remain compatible.
Matched runtime-input results, 20 million steps, median total process time:
| Workload | RF2 0.10 | RF2 0.11 | Clang O3 |
|---|---|---|---|
| Periodic sum | 24.878 ms | 1.842 ms | 3.841 ms |
| Mixed arithmetic | 57.312 ms | 22.496 ms | 22.232 ms |
| Branch-heavy | 22.486 ms | 20.216 ms | 6.501 ms |
One Apple Silicon Mac, seven rotated fresh-process trials per variant and size, identical runtime inputs, all outputs checked. The equally specialised C formula and smaller cases remain in the raw report. Startup variation prevents a general formula-speed conclusion. The branch-heavy gap remains open. No universal speed, new mathematical discovery, AI inference or new token-saving claim.
Verification includes 240 direct-iteration cases, 80 large-integer expectations, 60 fallback cases, 2,205 instruction cases, 180 control cases, five condition-side-effect cases and 340 narrowing cases, plus compiler fixed-point, ABI, application and installed MCP SDK regressions. Clean packages were extracted, checked and launched.
The revised book has 23 chapters and 68 pages. Native binaries target Apple Silicon macOS; the Studio bundle is ad hoc signed, not notarised. Developer verification tools remain in the source repository.
Contracts and raw measurements: Native optimisation.
Created by Ilangkhumanan Thirunavokkarasu. Published by SFE. MIT licence.