PLAIN FIXED-POINT C
—modeled cycles / mesh— cycles / vertexCOMPILED FOR SH-2
Saturn math.
Before and after.
The same mesh, with and without SH2ZAM.
Loading visual preview…
Ring world
Loading mesh…
SH-2 transform cost
Loading evidence…SH2ZAM · NATIVE MAC.L
—modeled cycles / mesh— cycles / vertexTRANSFORM COST SAVED
—Awaiting model evidenceCompiled SH-2 code · per-matrix setup included · instruction model, not a console timing capture.
Same geometry. Checked precision.
A low-poly planet and concentric rings, transformed in lockstep.
The preview runs in your browser. Performance figures above come from the recorded SH-2 model.
Optimize the whole workload
Awaiting native captureReuse one rotation across a mesh, index repeated spatial queries, and improve the existing scalar kernels. Every cost below includes setup and output writes on the same compiled SH-2 model.
RECORDED CONTROL
—modeled cycles / workloadAwaiting native evidenceNEW IMPLEMENTATION
—modeled cycles / workloadSetup includedWORKLOAD COST SAVED
—Not measuredNo validated workload capture is available yet.
| Implementation | Cycles / workload | Cycles / item | Selected control / path |
|---|---|---|---|
| Awaiting native capture | |||
Only exact, validated native observations will appear here.
Every workload, including slower cases
The overview uses each case’s fastest recorded control. Rotation uses the new optional MAC.L batch; spatial queries use the index. Scalar kernels compare against the latest prior revision, 3374d77.
| Workload | Profile / size | Fastest control | New cycles | Change |
|---|---|---|---|---|
| Not measured | ||||
Raw samples, precision & build provenance
One SH-2 CPU, flat RAM. The model excludes cache and bus delays, pipeline and multiplier contention, interrupts, peripherals, and second-CPU traffic. No browser timings, Saturn milliseconds, or FPS estimates are used.
Math library improvements
Awaiting native captureThe existing math APIs, before and after optimization. Both versions are compiled for SH-2. This compares library revisions; the transform comparison above uses an independent baseline.
| Input profile | Prior SH2ZAM 10786b6 | Optimized SH2ZAM | Cost change | Precision |
|---|---|---|---|---|
| Bounded | — | — | Not measured | Awaiting checks |
| Tiny | — | — | Not measured | Awaiting checks |
| Full range | — | — | Not measured | Awaiting checks |
Awaiting a validated native SH-2 capture. No math performance figures are available yet.
What changes in your code
Integration examples ↗Without SH2ZAM · one fixed-point row
// Bounds qualified for this matrix.
int64_t sum =
(int64_t)row[0] * x
+ (int64_t)row[1] * y
+ (int64_t)row[2] * z;
// SH-2 arithmetic shift floors once.
out = (int32_t)((sum >> 16) + row[3]);Complete baseline source ↗With SH2ZAM · optional native MAC.L
sh2z_mesh_view_t mesh;
sh2z_transform_plan_t plan;
// Once for an immutable mesh:
if (!sh2z_mesh_view_init(&mesh, vertices, count))
return false;
// Each new matrix:
if (!sh2z_transform_plan_init(&plan, &mesh, &matrix))
return false;
return sh2z_transform_plan_execute_mac(
out, &plan, 0, count);API and contracts ↗MAC.L is an optional experimental API. It uses native accumulation when bounds qualify and SR.S is clear; otherwise it uses the prepared fallback.
Results & measurement details
Every implementation receives the same quantized vertices and matrices. Costs are medians across 21 poses; matrix qualification is included once per whole mesh. Mesh scanning and input conversion happen once, outside the measured transform.
| Implementation | Cycles / mesh | Cycles / vertex | Baseline / path |
|---|---|---|---|
| Plain fixed-point C without SH2ZAM | — | — | — |
| Software float without SH2ZAM | — | — | — |
| SH2ZAM prepared C | — | — | — |
| SH2ZAM native MAC.L optional API | — | — | — |
| SH2ZAM native DMULS.L optional API | — | — | — |
| SH2ZAM prior safe batch | — | — | — |
The fixed-point baseline uses independent C arithmetic with three unrolled rows, cached matrix values and one rounding step per dot product. It does not call SH2ZAM. All native paths are built with the same SH-2 compiler and optimization flags.
The instruction model uses flat RAM. It excludes cache and bus delays, pipeline and multiplier contention, interrupts, peripherals and the second CPU. These figures describe modeled transform work; they are not whole-game FPS or measured Saturn milliseconds.