KMeans reference
NATIVE CPU · RECORDED EVIDENCE

KMeans benchmarks

Inspect fitting, prediction and explicit local CPU workers alongside the numerical corrections that define the new serial baseline.

For Batch, four reused workers take 1.8106 ms to fit versus 5.2096 ms for corrected serial (2.88×). Prediction takes 2.1249 ms versus 7.7500 ms (3.65×). These speedups divide corrected serial time by four-worker time; the tables also preserve the legacy serial measurements.

The corrected implementation's serial path costs more here: Batch corrected serial takes 1.68× the legacy fit time and 1.58× the legacy prediction time. Legacy serial measured 3.0969 ms for fit and 4.9125 ms for prediction. The four-worker before-and-after speedups are 1.71× and 2.31× respectively; these overall ratios differ from same-output worker scaling.

Numerical corrections can change centers, inertia, assignments and stopping behavior relative to legacy KMeans. A before-and-after timing is therefore a comparison of implementations on the declared workload. Same-output parallel scaling compares corrected serial with the corrected worker paths.

TIME, SCALING AND MEMORY

Follow the complete comparison.

Switch between fitting and prediction. Each worker bar uses the same corrected arithmetic; the legacy implementation remains a separate before-and-after reference.

Batch · Fit · N=4,096, Q=32,768, D=8, clusters=4. Reused local CPU pools.

  • Corrected arithmetic
  • Legacy serial: results may differ

Fit latency

Median call time · lower is faster

0 ms3 ms6 ms
Legacy serial3.10 ± 0.01 ms
Corrected serial5.21 ± 0.03 ms
1 worker5.46 ± 0.02 ms
2 workers2.96 ± 0.06 ms
4 workers1.81 ± 0.03 ms
Whiskers and ± values show MAD, the median absolute deviation, not a confidence interval. Numerical corrections can change legacy outputs and iteration counts; legacy timing is not a same-output scaling measurement.

Worker speedup

Corrected serial median ÷ worker median

0×1.5×3×
1 worker0.95×
2 workers1.76×
4 workers2.88×
The dashed 1× line marks equal time. These ratios isolate worker scaling from the numerical changes between legacy and corrected serial implementations.

Charged workspace

Checked operation admission · lower is smaller

0 KiB40 KiB80 KiB
Corrected serial65.95 KiB
1 worker65.95 KiB
2 workers66.77 KiB
4 workers68.40 KiB
Charged bytes converted to KiB, separate from process RSS. Fit includes new fitted state; prediction excludes its existing model. A configured workspace cap is not a fixed allocation.

Process peak RSS

Fresh-process lifetime high-water mark

0 MiB4 MiB8 MiB
Legacy serial8.00 MiB
Corrected serial7.94 MiB
1 worker7.94 MiB
2 workers7.97 MiB
4 workers7.98 MiB
Maximum recorded fresh-process getrusage lifetime peak, converted to MiB. Includes process, input, runtime and operation memory. Prediction also includes its prerequisite serial fit. It is not isolated kernel scratch and no input baseline has been subtracted.

Corrected serial and admitted 1, 2 and 4 worker runs are checked bitwise in the same build and floating-point environment. Full tables below retain repetitions, stopping state and cold-pool costs.

Fitting with corrected arithmetic

The fit timer includes initialization, Lloyd assignment and mean updates, final assignments, inertia and fitted-state construction. Input preparation and independent verification are outside that timer. Reused contexts exist before the call. Completed iterations and convergence flags remain visible because a faster run that performs a different number of updates needs that context.

Batch

N=4,096, Q=32,768, D=8, clusters=4, iteration cap=20, seed=42, synthetic distribution=balanced.

Fit timings — Batch
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)3.0969 ± 0.0130005.2096 ± 0.0262515.4577 ± 0.0189592.9627 ± 0.0583341.8106 ± 0.033833
Repetitions77777
Corrected serial ÷ time1.68×1.00×0.95×1.76×2.88×
Reused 1 worker ÷ time1.76×1.05×1.00×1.84×3.01×
Legacy serial ÷ time1.00×0.59×0.57×1.05×1.71×
Completed iterations44444
Convergedtruetruetruetruetrue

Wide

N=2,048, Q=4,096, D=32, clusters=8, iteration cap=20, seed=42, synthetic distribution=balanced.

Fit timings — Wide
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)47.914 ± 0.09279354.920 ± 0.1041355.302 ± 0.3743728.308 ± 0.1355015.143 ± 0.11738
Repetitions77777
Corrected serial ÷ time1.15×1.00×0.99×1.94×3.63×
Reused 1 worker ÷ time1.15×1.01×1.00×1.95×3.65×
Legacy serial ÷ time1.00×0.87×0.87×1.69×3.16×
Completed iterations99999
Convergedtruetruetruetruetrue

Prediction against fitted centers

Prediction timings exclude model fitting. Corrected serial and worker predictions use the same corrected fitted centers. Legacy prediction uses the legacy fitted model, whose centers can differ after the numerical corrections. Prediction still compares every query with every center; workers divide rows without changing the nearest-center tie rule.

Batch

N=4,096, Q=32,768, D=8, clusters=4, iteration cap=20, seed=42, synthetic distribution=balanced.

Prediction timings — Batch
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)4.9125 ± 0.0471257.7500 ± 0.112927.4720 ± 0.0910003.9915 ± 0.0623752.1249 ± 0.032582
Repetitions77777
Corrected serial ÷ time1.58×1.00×1.04×1.94×3.65×
Reused 1 worker ÷ time1.52×0.96×1.00×1.87×3.52×
Legacy serial ÷ time1.00×0.63×0.66×1.23×2.31×

Wide

N=2,048, Q=4,096, D=32, clusters=8, iteration cap=20, seed=42, synthetic distribution=balanced.

Prediction timings — Wide
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)9.6002 ± 0.04504110.664 ± 0.09858410.569 ± 0.115715.3197 ± 0.0202493.0217 ± 0.071792
Repetitions77777
Corrected serial ÷ time1.11×1.00×1.01×2.00×3.53×
Reused 1 worker ÷ time1.10×0.99×1.00×1.99×3.50×
Legacy serial ÷ time1.00×0.90×0.91×1.80×3.18×

Small calls, more centers and iteration limits

All measured workloads remain available, including calls for which pool overhead can dominate. These are deterministic synthetic numerical workloads, not a measurement of clustering quality on a scientific dataset. They expose dimensions, cluster count, seed and iteration cap. These elapsed-time observations stay within the existing work limits; requesting more workers does not increase those limits.

Tiny · N=32, D=4, clusters=2

N=32, Q=1, D=4, clusters=2, iteration cap=20, seed=42, synthetic distribution=balanced.

Fit timings — Tiny
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)0.0047500 ± 0.0000840000.014416 ± 0.000417000.064041 ± 0.00445900.079000 ± 0.0171250.16233 ± 0.011958
Repetitions77777
Corrected serial ÷ time3.03×1.00×0.23×0.18×0.09×
Reused 1 worker ÷ time13.48×4.44×1.00×0.81×0.39×
Legacy serial ÷ time1.00×0.33×0.07×0.06×0.03×
Completed iterations33333
Convergedtruetruetruetruetrue
Prediction timings — Tiny
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)0.00012500 ± 0.00000.00020900 ± 0.00000100000.0078750 ± 0.000541000.0062910 ± 0.00104300.012750 ± 0.0060830
Repetitions77777
Corrected serial ÷ time1.67×1.00×0.03×0.03×0.02×
Reused 1 worker ÷ time63.00×37.68×1.00×1.25×0.62×
Legacy serial ÷ time1.00×0.60×0.02×0.02×0.01×
Larger · N=8192, D=16, clusters=16

N=8,192, Q=32,768, D=16, clusters=16, iteration cap=20, seed=42, synthetic distribution=balanced.

Fit timings — Larger
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)286.27 ± 1.0055339.64 ± 0.76033341.58 ± 0.33842172.62 ± 0.2358393.825 ± 1.2396
Repetitions77777
Corrected serial ÷ time1.19×1.00×0.99×1.97×3.62×
Reused 1 worker ÷ time1.19×1.01×1.00×1.98×3.64×
Legacy serial ÷ time1.00×0.84×0.84×1.66×3.05×
Completed iterations2020202020
Convergedfalsefalsefalsefalsefalse
Prediction timings — Larger
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)53.502 ± 0.3470863.009 ± 0.1836762.751 ± 0.1579231.806 ± 0.09520916.070 ± 0.048916
Repetitions77777
Corrected serial ÷ time1.18×1.00×1.00×1.98×3.92×
Reused 1 worker ÷ time1.17×1.00×1.00×1.97×3.90×
Legacy serial ÷ time1.00×0.85×0.85×1.68×3.33×
Many clusters · N=4096, D=8, clusters=32

N=4,096, Q=8,192, D=8, clusters=32, iteration cap=20, seed=42, synthetic distribution=balanced.

Fit timings — Many clusters
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)65.373 ± 0.1942192.461 ± 0.1337993.638 ± 0.1398347.480 ± 0.1005428.646 ± 1.4981
Repetitions77777
Corrected serial ÷ time1.41×1.00×0.99×1.95×3.23×
Reused 1 worker ÷ time1.43×1.01×1.00×1.97×3.27×
Legacy serial ÷ time1.00×0.71×0.70×1.38×2.28×
Completed iterations1313131313
Convergedtruetruetruetruetrue
Prediction timings — Many clusters
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)9.3179 ± 0.007334012.852 ± 0.03283312.828 ± 0.0636256.5280 ± 0.0512503.6421 ± 0.082417
Repetitions77777
Corrected serial ÷ time1.38×1.00×1.00×1.97×3.53×
Reused 1 worker ÷ time1.38×1.00×1.00×1.97×3.52×
Legacy serial ÷ time1.00×0.73×0.73×1.43×2.56×
Every row a center · N=128, D=4, clusters=128

N=128, Q=4,096, D=4, clusters=128, iteration cap=10, seed=42, synthetic distribution=balanced.

Fit timings — Every row a center
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)0.41604 ± 0.00329300.68217 ± 0.000876000.74246 ± 0.00295900.39063 ± 0.00312500.30892 ± 0.0094590
Repetitions77777
Corrected serial ÷ time1.64×1.00×0.92×1.75×2.21×
Reused 1 worker ÷ time1.78×1.09×1.00×1.90×2.40×
Legacy serial ÷ time1.00×0.61×0.56×1.07×1.35×
Completed iterations11111
Convergedtruetruetruetruetrue
Prediction timings — Every row a center
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)6.5955 ± 0.00866708.3446 ± 0.0668758.3009 ± 0.0131254.1979 ± 0.0305002.3080 ± 0.090167
Repetitions77777
Corrected serial ÷ time1.27×1.00×1.01×1.99×3.62×
Reused 1 worker ÷ time1.26×0.99×1.00×1.98×3.60×
Legacy serial ÷ time1.00×0.79×0.79×1.57×2.86×
Overlapping batch · N=4096, D=8, clusters=4

N=4,096, Q=32,768, D=8, clusters=4, iteration cap=20, seed=42, synthetic distribution=overlap.

Fit timings — Overlapping batch
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)6.2575 ± 0.05404211.457 ± 0.04937511.821 ± 0.0340416.4126 ± 0.157374.0386 ± 0.15683
Repetitions77777
Corrected serial ÷ time1.83×1.00×0.97×1.79×2.84×
Reused 1 worker ÷ time1.89×1.03×1.00×1.84×2.93×
Legacy serial ÷ time1.00×0.55×0.53×0.98×1.55×
Completed iterations99999
Convergedtruetruetruetruetrue
Prediction timings — Overlapping batch
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)4.8536 ± 0.0218757.6184 ± 0.0197097.6230 ± 0.0607923.9058 ± 0.00658302.4747 ± 0.12113
Repetitions77777
Corrected serial ÷ time1.57×1.00×1.00×1.95×3.08×
Reused 1 worker ÷ time1.57×1.00×1.00×1.95×3.08×
Legacy serial ÷ time1.00×0.64×0.64×1.24×1.96×
Skewed batch · N=4096, D=8, clusters=4

N=4,096, Q=32,768, D=8, clusters=4, iteration cap=20, seed=42, synthetic distribution=skew.

Fit timings — Skewed batch
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)13.077 ± 0.08199921.117 ± 0.05775121.655 ± 0.04025011.840 ± 0.236547.9038 ± 0.61383
Repetitions77777
Corrected serial ÷ time1.61×1.00×0.98×1.78×2.67×
Reused 1 worker ÷ time1.66×1.03×1.00×1.83×2.74×
Legacy serial ÷ time1.00×0.62×0.60×1.10×1.65×
Completed iterations2020202020
Convergedfalsefalsefalsefalsefalse
Prediction timings — Skewed batch
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)4.8413 ± 0.0110837.1431 ± 0.0737097.0951 ± 0.0122913.6573 ± 0.0532081.9753 ± 0.023667
Repetitions77777
Corrected serial ÷ time1.48×1.00×1.01×1.95×3.62×
Reused 1 worker ÷ time1.47×0.99×1.00×1.94×3.59×
Legacy serial ÷ time1.00×0.68×0.68×1.32×2.45×
One-update batch · N=4096, D=8, clusters=4

N=4,096, Q=32,768, D=8, clusters=4, iteration cap=1, seed=42, synthetic distribution=balanced.

Fit timings — One-update batch
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)1.2095 ± 0.0111672.2155 ± 0.0167492.2635 ± 0.0403751.2040 ± 0.00637500.79513 ± 0.023500
Repetitions77777
Corrected serial ÷ time1.83×1.00×0.98×1.84×2.79×
Reused 1 worker ÷ time1.87×1.02×1.00×1.88×2.85×
Legacy serial ÷ time1.00×0.55×0.53×1.00×1.52×
Completed iterations11111
Convergedfalsefalsefalsefalsefalse
Prediction timings — One-update batch
MetricLegacy serialCorrected serial1 worker2 workers4 workers
Median ± MAD (ms)4.8251 ± 0.0123757.9992 ± 0.0482508.1779 ± 0.146124.2197 ± 0.0118742.3629 ± 0.073792
Repetitions77777
Corrected serial ÷ time1.66×1.00×0.98×1.90×3.39×
Reused 1 worker ÷ time1.69×1.02×1.00×1.94×3.46×
Legacy serial ÷ time1.00×0.60×0.59×1.14×2.04×
Cold context creation and destruction — every workload

Each cell reports median ± MAD in milliseconds, followed by repetitions in parentheses. Cold measurements include context creation and destruction; reused measurements exclude them. Pool startup is not hidden inside the scaling comparison.

Fit pool setup — Tiny
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context0.064041 ± 0.0044590 (7)0.079000 ± 0.017125 (7)0.16233 ± 0.011958 (7)
Create and destroy context0.077291 ± 0.0089160 (7)0.14483 ± 0.025417 (7)0.23067 ± 0.047333 (7)
Prediction pool setup — Tiny
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context0.0078750 ± 0.00054100 (7)0.0062910 ± 0.0010430 (7)0.012750 ± 0.0060830 (7)
Create and destroy context0.039583 ± 0.0030840 (7)0.067459 ± 0.0058760 (7)0.092250 ± 0.0055420 (7)
Fit pool setup — Batch
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context5.4577 ± 0.018959 (7)2.9627 ± 0.058334 (7)1.8106 ± 0.033833 (7)
Create and destroy context5.5490 ± 0.047625 (7)3.0724 ± 0.039000 (7)1.9154 ± 0.13038 (7)
Prediction pool setup — Batch
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context7.4720 ± 0.091000 (7)3.9915 ± 0.062375 (7)2.1249 ± 0.032582 (7)
Create and destroy context7.6766 ± 0.097000 (7)4.0503 ± 0.037084 (7)2.2476 ± 0.020167 (7)
Fit pool setup — Wide
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context55.302 ± 0.37437 (7)28.308 ± 0.13550 (7)15.143 ± 0.11738 (7)
Create and destroy context55.273 ± 0.065167 (7)28.454 ± 0.10742 (7)15.799 ± 0.29508 (7)
Prediction pool setup — Wide
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context10.569 ± 0.11571 (7)5.3197 ± 0.020249 (7)3.0217 ± 0.071792 (7)
Create and destroy context10.589 ± 0.027041 (7)5.4251 ± 0.034667 (7)3.0167 ± 0.064916 (7)
Fit pool setup — Larger
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context341.58 ± 0.33842 (7)172.62 ± 0.23583 (7)93.825 ± 1.2396 (7)
Create and destroy context341.97 ± 1.0800 (7)173.21 ± 0.037583 (7)104.80 ± 0.91817 (7)
Prediction pool setup — Larger
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context62.751 ± 0.15792 (7)31.806 ± 0.095209 (7)16.070 ± 0.048916 (7)
Create and destroy context63.018 ± 0.088625 (7)31.464 ± 0.044250 (7)16.665 ± 0.20479 (7)
Fit pool setup — Many clusters
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context93.638 ± 0.13983 (7)47.480 ± 0.10054 (7)28.646 ± 1.4981 (7)
Create and destroy context93.500 ± 0.32625 (7)49.386 ± 0.88321 (7)27.673 ± 0.15063 (7)
Prediction pool setup — Many clusters
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context12.828 ± 0.063625 (7)6.5280 ± 0.051250 (7)3.6421 ± 0.082417 (7)
Create and destroy context13.021 ± 0.083958 (7)6.5108 ± 0.021958 (7)3.5611 ± 0.094418 (7)
Fit pool setup — Every row a center
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context0.74246 ± 0.0029590 (7)0.39063 ± 0.0031250 (7)0.30892 ± 0.0094590 (7)
Create and destroy context0.75392 ± 0.0062490 (7)0.44871 ± 0.0065410 (7)0.36950 ± 0.0030420 (7)
Prediction pool setup — Every row a center
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context8.3009 ± 0.013125 (7)4.1979 ± 0.030500 (7)2.3080 ± 0.090167 (7)
Create and destroy context8.4000 ± 0.015001 (7)4.3032 ± 0.050583 (7)2.3859 ± 0.074417 (7)
Fit pool setup — Overlapping batch
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context11.821 ± 0.034041 (7)6.4126 ± 0.15737 (7)4.0386 ± 0.15683 (7)
Create and destroy context11.977 ± 0.17700 (7)6.3655 ± 0.056917 (7)4.3361 ± 0.35596 (7)
Prediction pool setup — Overlapping batch
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context7.6230 ± 0.060792 (7)3.9058 ± 0.0065830 (7)2.4747 ± 0.12113 (7)
Create and destroy context7.7270 ± 0.071708 (7)4.5602 ± 0.47208 (7)2.5103 ± 0.12008 (7)
Fit pool setup — Skewed batch
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context21.655 ± 0.040250 (7)11.840 ± 0.23654 (7)7.9038 ± 0.61383 (7)
Create and destroy context21.749 ± 0.012958 (7)13.040 ± 0.68929 (7)7.9622 ± 0.32004 (7)
Prediction pool setup — Skewed batch
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context7.0951 ± 0.012291 (7)3.6573 ± 0.053208 (7)1.9753 ± 0.023667 (7)
Create and destroy context7.1392 ± 0.033209 (7)3.7609 ± 0.016625 (7)2.0567 ± 0.058167 (7)
Fit pool setup — One-update batch
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context2.2635 ± 0.040375 (7)1.2040 ± 0.0063750 (7)0.79513 ± 0.023500 (7)
Create and destroy context2.2826 ± 0.010750 (7)1.2730 ± 0.011167 (7)0.93112 ± 0.0077080 (7)
Prediction pool setup — One-update batch
Median ± MAD (ms), repetitions1 worker2 workers4 workers
Reused context8.1779 ± 0.14612 (7)4.2197 ± 0.011874 (7)2.3629 ± 0.073792 (7)
Create and destroy context8.0258 ± 0.26500 (7)4.2960 ± 0.047458 (7)2.4812 ± 0.11513 (7)

Charged workspace admission

These are checked charged bytes for an individual operation on the recorded ABI. Every listed boundary rejects a budget one byte below its charge and accepts the exact charged budget. The charge is an admission-accounting quantity, not process RSS, peak allocator use or the whole memory footprint. The default workspace limit is 64 MiB, a cap, not a fixed allocation.

Fit admission includes newly fitted centers and labels along with working capacities and bounded controls. Prediction includes its new output and controls, while the existing immutable model is outside that call's charge. Source Tensor storage and host caches, executor internals, callback/context snapshot payloads, opaque ownership and allocator overhead, thread stacks and process RSS are excluded. Worker-private scratch can grow with active lanes. These scopes follow the recorded implementation and ABI; unmeasured workload/operation pairs have no inferred memory value.

Workspace admission
WorkloadOperationExecutionActive lanesCharged bytesCharged KiB
BatchFitCorrected serial167,53265.949
BatchFit1 worker167,53265.949
BatchFit2 workers268,36866.766
BatchFit4 workers470,04068.398
BatchPredictionCorrected serial1262,528256.375
BatchPrediction1 worker1262,528256.375
BatchPrediction2 workers2262,544256.391
BatchPrediction4 workers4262,576256.422
WideFitCorrected serial138,41237.512
WideFit1 worker138,41237.512
WideFit2 workers239,24838.328
WideFit4 workers440,92039.961
WidePredictionCorrected serial133,15232.375
WidePrediction1 worker133,15232.375
WidePrediction2 workers233,16832.391
WidePrediction4 workers433,20032.422

Process memory, measured separately

Each RSS sample comes from a fresh process and records the getrusage lifetime high-water mark. The table reports the maximum recorded sample in MiB. It includes executable/runtime overhead, inputs, model state, executor resources and the operation. Prediction RSS also includes the prerequisite serial fit that created that implementation's model. No input baseline has been subtracted. This cannot be read as isolated kernel scratch or compared directly with charged workspace as if they measured the same scope. Platform RSS units are normalized to bytes in the downloadable report.

Fresh-process peak RSS
WorkloadOperationImplementationExecutionPeak MiBFresh processes
BatchFitlegacySerial8.0003
BatchFitcorrectedSerial7.9383
BatchFitcorrected1 worker · reused pool7.9383
BatchFitcorrected2 workers · reused pool7.9693
BatchFitcorrected4 workers · reused pool7.9843
BatchPredictionlegacySerial8.2813
BatchPredictioncorrectedSerial8.1883
BatchPredictioncorrected1 worker · reused pool8.2033
BatchPredictioncorrected2 workers · reused pool8.2193
BatchPredictioncorrected4 workers · reused pool8.2503
WideFitlegacySerial7.2343
WideFitcorrectedSerial7.1563
WideFitcorrected1 worker · reused pool7.2033
WideFitcorrected2 workers · reused pool7.2193
WideFitcorrected4 workers · reused pool7.2503
WidePredictionlegacySerial7.2503
WidePredictioncorrectedSerial7.1883
WidePredictioncorrected1 worker · reused pool7.1883
WidePredictioncorrected2 workers · reused pool7.2033
WidePredictioncorrected4 workers · reused pool7.2343

Accuracy and determinism

The recorded independent numerical oracle passes 14,584 cases, including cancellation in means, tiny residuals, inertia underflow and finite/overflow boundaries. A finite center must remain within the coordinate bounds of its assigned population. Such checks assess the numerical update; they do not establish global optimality for Lloyd clustering. Inertia accumulates the exact squares of the computed Float64 distance norms before final rounding; the distance norms themselves still use floating-point subtraction and hypot.

Corrected serial and admitted 1, 2 and 4 worker executions are compared bitwise in the same binary and floating-point environment: centers, fitted labels, query predictions, inertia, completed iterations and convergence flags. This is a same-build promise; it does not claim identical results across different platforms, compiler versions or math libraries. Legacy results are evaluated separately because correcting numerical behavior can legitimately change them.

Distance ties choose the lowest center index; an empty cluster retains its previous center. Final fitted labels and inertia are recomputed against the returned centers. At an iteration cap or a tolerance stop, those final assignments need not be the memberships used for the last center update. A final center is therefore not asserted to be the mean of the final labels unless the assignments have stabilized.

Validation also covers cancellation, deterministic failures and context reuse. A cancelled or failed call returns no partial successful fitted model or prediction Tensor. All workers must finish before scratch or captured inputs are released. The downloadable report identifies the exact validation and source revisions used for these observations.

Scope and reproduction

Recorded build and machine
Operating systemmacOS-26.7.2-arm64-arm-64bit
KernelDarwin 25.6.0
Physical CPU reported by hostApple M2 Max
Architecture / logical CPUsarm64 / 12
CompilerApple clang version 21.0.0 (clang-2100.3.34.2) Target: arm64-apple-darwin25.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Build / LTORelease / ThinLTO
Compiler CPU profileapple-m1 (instruction baseline, separate from host identification)

Recorded 2026-10-30. Timings use a matched Release build with ThinLTO, strict -fno-fast-math and -ffp-contract=off. Raw observations, build and machine identities, numerical validation, workspace admission and fresh-process RSS samples are downloadable together. Medians and MADs on this page are recomputed from the raw samples; MAD describes sample dispersion, not a confidence interval.

With I completed Lloyd updates, fitting retains O((I+1)NkD) distance work, including final reassignment. Prediction remains O(QkD). Parallelism changes elapsed time, not the declared distance count or admission limits. The fitting cap uses (max_iterations+1)NkD ≤ 50,000,000; prediction uses QkD ≤ 50,000,000, and each Tensor is bounded to one million elements. The cap is checked using the requested iteration maximum, even when fitting converges earlier.

These local CPU measurements do not establish GPU, cluster or universal speedups. Worker counts describe admitted local concurrency, not pinned or dedicated cores. The native KMeans implementation does not extend the bounded aner build Tensor/model lowering subset. Reproduce comparisons using the report's exact source, build flags, dataset generator, seed, controls and timing boundaries; keep verification outside the timed region.

See the KMeans contract, recorded benchmark study, implementation and validation notes, complete local execution example and serial reference example. The standalone benchmark figure and plot reproduction tool present the same evidence in an exportable form. No development runtime package is published with this page.