Loan amount graph
CPU calcMath + CalculationsEngine still compute the live numbers (already microseconds).
WebGPU paints the cascade and runs an integer-cent kernel as a verifier — not a speed-up.
Default GPU f32 dollar floats cannot safely round loan-sized cents.
GPU: detecting…
Teal nodes are results; cooler nodes are inputs. Heat pulses when DAG-lite recomputes a cell.
Live chain — calcMath vs integer cents vs GPU
GPU cents should match CPU integer cents. calcMath is the binary64 rounding heuristic used on the worksheet.
| Cell | calcMath | CPU integer ¢ | GPU integer ¢ | GPU source |
|---|
Float drift exhibit
A base of 300000.27 times a 1.75% fee. Integer cents round to $5,250.00; 32-bit floats miss by 1¢.
The live graph floors that base to whole dollars, so this row is a separate example.
| Base dollars | Fee % | Integer ¢ | f32 rounded ¢ | Delta |
|---|
Prototype analysis — what this proves (and what it does not)
This page is a prototype: WebGPU visualizes a loan-amount graph and verifies an integer-cent chain.
The live product worksheet still runs on CPU calcMath + CalculationsEngine.
Microseconds vs milliseconds
A microsecond is 1/1,000,000 of a second. The loan chain finishes in tens of microseconds — already “free” for keystroke UI.
A millisecond is 1/1,000 of a second — 1,000× a microsecond. GPU setup, dispatch, and CPU readback usually land in a few milliseconds for this tiny DAG.
Bottom line: for one loan, GPU is slower. Humans notice ~100 ms; both paths still feel instant — the point is engineering cost, not UX lag.
Precision (formal claims)
f32dollar floats cannot safely round loan-sized cents (see the drift exhibit above).- Integer cents (
i32) make add / subtract / min / floor-to-dollar exact for typical loan sizes (~$21M max in cents). - GPU does not add precision — the integer representation does. The same integer-cent rules run on the CPU.
- The fee uses a named half-up rule — research/demo only.
Where this could matter theoretically
- Batch / stress grids — thousands of independent scenarios in one dispatch (rate × balance × factor), not one keystroke chain.
- Teach / audit / demos — pulse the graph so the add-on total through the final amount is easy to follow.
- Second-opinion verifier — GPU cents match CPU integer cents, while the worksheet stays on decimal
calcMath.
Where not to use it
- Replacing the live worksheet recalculation.
- Trusting default GPU
f32dollars for money. - Expecting a speed-up on an 11-node sequential DAG.
Thesis: WebGPU here is a visual + exact-cent research layer. Product calculators stay on CPU. Scale the kernel only when the workload is many independent loans, not one form.