Repository navigation
Conversation
|
Local SF10 evidence for Memory screen
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. Disk screen
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. Independent memory confirmation
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. The initial memory screen flagged Q8 at+1.52% (95% interval+0.40% to+2.65%). The independent same-order confirmation has no slower-query intervals; disk mode has none. Profiles are separate: Q1 instructions126.034B→118.476B(-6.00%), Q9 instructions37.502B→36.909B(-1.58%). The Q1 profiler windows each contain53KiB residual reads and are not strict zero-I/O evidence. SF100 is running on quiet server129 with the existing database, all64 CPUs/interleaved NUMA and the approved budgets. This PR remains draft until that gate passes. The independent reduction candidate still has unresolved control regressions and is not included in this PR. |
Complete Q1–Q22 profiling against mainBaseline
Separate profiled windows, normalized by completed repetitions. Total sums the per-query normalized costs. These single-window diagnostics are not paired latency acceptance. SIMD is a subset of decimal-expression samples, not an exclusive category. Residual I/O and interference are retained in the JSON records. The instruction reduction is concentrated in Q1 and Q9. All other20 queries stay within about±0.3% instructions. Across all22 queries, instructions fall528.908B→520.725B(-1.55%), while summed normalized CPU in these separate windows rises71.5274s→72.0392s(+0.72%). This does not establish a full-suite speedup. It must not be summarized using Q1 alone. No spill, benchmark swap or compiler interference was observed. Non-zero-I/O windows: main Q6 (4096 read bytes), main Q20 (53248 read bytes), typed Q6 (32768 read bytes), typed Q10 (53248 read bytes), typed Q20 (53248 read bytes). They remain flagged rather than being presented as strict zero-I/O evidence. The earlier paired latency tables cover all22 queries, both memory and disk modes, with Total rows. The memory Q8 screen signal did not reproduce in independent same-order confirmation. SF100 remains unaccepted following its rejected interference window; readiness is unchanged. |
Replace AVX-512-only signed64 shifts with AVX2 sign masks and current Go SIMD bitcast operations. Hoist coefficient guards and establish multiplication views outside the row loop. Derive widened sum/difference sign limbs directly while preserving exact 65/129-bit results, declared carriers, checked publication and scalar fallback offsets. Exact boundary, alias and tail models, owning-package tests, Group consumers, normal SQL comparisons and compiled-kernel ISA inspection pass. This local checkpoint does not claim latency or TPC-H acceptance.
|
Implementation and performance checkpoint (unpublished refinements) The published PR head remains The refinement replaces AVX-512-only signed64 arithmetic shifts under the AVX2 Five alternating component-control blocks have no confirmed slower interval. Local TPC-H SF10 uses all32 CPUs,48GiB application/16GiB CN cache,32GiB SF10 RAM — complete collection:
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. Q1 improves4.31% with its95% interval entirely below zero. No query has a SF10 disk — partial collection, two of the required three process pairs:
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. The quiet-window attempt retained another complete valid disk pair. The final The same independent sources are built on server129 without transferring data |
|
Local acceptance completed for expression checkpoint No query or Total has a confirmed slower95% interval in either mode. RAM Q1 SF10 RAM:
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. SF10 disk:
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. The exact-source full pre-push gate passed with zero issues; previous unchanged |
|
SF100 RAM completed on expression Q1 improves3.70% (95% CI -4.78% to -2.60%). Total wall improvement is The disk phase was stopped once the complete RAM failure was identified.
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. |
Compute native add/sub in overflow-checked AVX2 prefixes and resume scalar execution at the first untouched block. Preserve in-place and broadcast operands, scale alignment, NULL handling and first-error publication. Use direct one-row scalar handling and signed-overflow identities to reduce fallback setup. Cover full signed128 endpoints, every overflow lane, aliases, broadcasts and untouched suffixes with independent exact models.
A nonnegative left operand can overflow only when subtrahend and result are both negative; a negative left operand can overflow only when both are nonnegative. Choose once before the scalar loop to remove repeated XORs while retaining full signed128 overflow and publication semantics.
Decimal128 add/sub correction: b765029Published commit Correctness and static validation
Component qualificationFive fixed alternating process pairs compare independent binaries with the same main context, identical fixtures, Go1.27.1, GOAMD64=v3, GOEXPERIMENT=simd and64-byte function alignment. First warm-ups are excluded; compiler/interference guards apply. The initial complete pair is retained after a compiler interruption, and resumption executes only missing arms, without adding scored pairs. All156 controls have zero confirmed regressions and zero allocations. The earlier V2 gate failed at constant-left subtraction n15 (+2.43% [1.86%,3.01%]); that failed result is retained. Hoisting the constant-sign decision corrects the scalar path. Component confidence intervals use the registered unadjusted95% paired t method on log ratios.
End-to-end acceptance remains incompleteThe local disk-backed SF100 Q1–Q22 comparison uses all32 CPUs,48GiB application/no swap,16GiB CN shared cache,32GiB aggregation/join spill thresholds and excluded cold suites. Two of three registered pairs are complete; Cargo restarted before the final pair. All four accepted suites are retained, and no spill/swap/OOM/compiler interference was accepted. This is a bounded screen with one scored warm full suite per startup.
These partial totals are not an acceptance verdict. The missing final SF100 pair and SF10 RAM/disk runs still need a compiler-free window. No row/schema/result verification is performed in benchmark scripts; existing loaded SF100 data is reused. SF10 raw inputs remain, and its load/run scripts are prepared without loading data. The PR remains draft under the existing performance gate. The independent shared-CI mode prerequisite is still #32325 / matrixorigin/CI#473; it is not bypassed by these local results. Separate compressed raw evidenceComponent release: seven separate gzip files,50,671 bytes total. They contain both failed V2 and corrected V3 raw pairs/intervals plus source/compiler metadata; no executable, database or sampled stack memory. |
Performance and validation history moved from the PR descriptionThis is an archived snapshot, copied intact from the description so the PR body can remain focused on the change and design. It contains results for several explicitly identified historical revisions, including superseded status statements. Those statements describe their original snapshots; they are not the latest PR state. For the published Decimal128 correction and remaining acceptance work, see the newer result comment.
Current native Decimal128 extension: validation and remaining gatesThe requester adds native Decimal128 add/sub to this PR and defers other new kernels. The native addition is commit
Small-batch multiplication and aggregate-reduction changes are outside this extension. The independent reduction PR retains its own performance blockers. Earlier qualification through expression88dc633dbeThe preceding expression88dc633dbeff scope included authoritative main57e7871e50. This section records that earlier qualification; it does not qualify the newly added native Decimal128 path. The component comparison uses main5792e1c372; the later main merge changes neither the measured arithmetic sources nor their contracts. Unchanged closures retain their evidence, and changed one-row/cast closures were remeasured after fixes. All rejected revisions and raw intervals are retained. Five alternating process pairs cover171 retained controls, with the first benchmark selection excluded. There is no confirmed slower control and no per-operation allocation. Ordinary checked Decimal64/Decimal128 add/sub candidates failed their controls and are removed. The table reports kernel elapsed time, not a whole-query speedup.
Historical SF10 results for expression88dc633dbeMatched sources57e7871e50 /88dc633dbe complete all22 local SF10 queries in RAM-backed and disk-backed modes, with Total wall/CPU rows below. Three alternating pairs, five warm suites after one excluded cold suite, all32 CPUs,48GiB application/16GiB CN cache and32GiB spill thresholds. No spill/swap/OOM/compiler interference was accepted. No query regression is Holm-confirmed and neither mode has a primary Total regression. RAM Q9 improves3.23% [95% CI -4.26%,-2.19%], adjusted target p0.005675; Q14 improves2.29% [-2.48%,-2.10%], adjusted p0.000557. Their instructions decrease in both separate diagnostic pairs: Q9 -2.06%/-2.92%; Q14 -0.79%/-0.47%. Q5 benefit is not confirmed. RAM Total's paired estimate is -0.56% [-1.40%,+0.29%]; overall speedup is not established. Disk variability leaves its Total and target benefits inconclusive. Actual instrumentation confirms Q9's shared prepared D64 multiply and Q14's fused revenue/selected widening. Ordinary D64-product admission is zero for these targets; it is not credited for their gains. The separately instrumented executable is excluded from timing. Hardware counts have CPU profiling disabled; the12 CPU profiles use separate short known-query workloads.
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded.
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. The displayed Total sums query medians; paired changes use independent process blocks. The approved Total/query/target Holm gates and all raw intervals are retained. Profiles and raw evidence are58 separate compressed files (1.08MB), without binaries/database/heap/raw stack-memory recordings. The 88dc633 local SF100 disk-backed screen is now complete (below). It establishes neither a suite speedup nor a regression; the wide interval is not evidence of equivalence. The separate CI coverage failure remains a merge blocker; ready-for-review status does not claim CI is green. The 88dc633dbe coverage check fails at40.34% (required >75%), with the same untested SIMD-backend files. The coverage producer omits SIMD-tagged unit tests. Shared CI workflow changes were explicitly kept out of scope; local tests/full static gates do not clear this CI blocker. Historical local SF100 disk-backed results for expression88dc633dbeIndependent current main
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. Paired Total wall is −1.29% [−13.70%, +12.90%] and paired CPU is −0.99% [−3.81%, +1.91%]: neither establishes an overall improvement. No raw 95% query slowdown interval is wholly positive, and no query fails the approved Holm gate. Displayed medians and paired percentages use different estimators; this is not a ratio-of-displayed-medians claim. Q5/Q9/Q14 wall changes remain inconclusive. Full paired data, resource limits and six separate gzip evidence files: complete SF100 report. The benchmark is stopped; the reusable loaded image is retained. No production code was changed for this screen. Historical measurements and profilesEverything below predates this coverage revision: expression4f39ccbc580e versus main007dd57a6192, before the dense-state main integration. These results remain historical and do not qualify88dc633dbeff. Five alternating component blocks have no confirmed slower control and no The complete local SF10 RAM/disk tables The complete four-pair SF100 RAM table Q15 diagnostic profiles and counters SF100 disk startup did not launch: its preflight measured29.28 busy CPU cores. Historical profilingThe earlier all22-query profile comparison |
Current-head CI diagnosis and actual Decimal128 SIMD coverageSource CI has two separate failures
Confirmed clean-main scheduling counterexampleA private Go source overlay adds only two scheduling/observation hooks to clean main
The diagnostic completed in 13.53 seconds including compilation and printed The fix needs to make the successful-drain queue check and scheduling-slot release one synchronized handoff, preserving the bounded retry policy on deletion failure. Increasing the test timeout would not address this state. No queue/transaction production changes were folded into this decimal PR. The separate integer RC-transfer failure remains unattributed; isolated passes do not waive it. Why component speedups yield little TPC-H improvementA diagnostic-only source overlay counts the native and prepared D128 add/sub paths across all 22 SF100 queries, with all 32 CPUs, 48 GiB/no swap, 16 GiB cache and 32 GiB spill thresholds. One complete cold suite is excluded before counter collection. Production source and the timed executable remain unchanged. These are activation counts, not latency acceptance.
The new native addition path is unused by this run. Native subtraction appears only in Q8 and Q14, processing 1,481,040 values with SIMD out of 1,490,216 native values (~99.38%). Its eligible work is already almost fully vectorized; the amount of work reaching it is small. Q9 processes 30,058,496 values through the prepared SIMD subtraction path already present in earlier revisions of #32237, which this native extension does not accelerate further. This prepared SIMD implementation is part of the PR, not main; its input counter includes scalar tails. Q1/Q5 do not call the new native D128 add/sub paths. These counters measure the reach of the latest native add/sub extension, not the reach of every multiplication/cast/fused kernel in the full PR. The earlier matched SF10 profiles independently show the larger costs: Q5 hash lookup ~25% flat CPU, Q9 hash lookup ~24% cumulative plus projection/copying, Q14 ordered filtering ~16% and decompression ~10%. Those percentages belong to the earlier matched profiling sources, not this counter-only run. They explain why a fast arithmetic primitive cannot translate directly into a comparable whole-query gain. For Q5, the earlier shape probe observed 7,329 non-NULL calls covering 72,985 coefficients; every call had fewer than 32 values (about 10 per call), below the fused SIMD threshold. Its fused decimal executor was only about 0.2% of sampled CPU. This is a concrete dispatch limitation, but its measured CPU share is too small to promise a large Q5 gain merely by lowering a threshold. The latest timed SF100 comparison remains incomplete (two of three pairs), and has not established a suite gain. Further improvement should follow measured path coverage rather than add more native decimal kernels blindly. Q5 small-batch work and join/filter/materialization changes remain separate follow-ups. The 8,192-row native component wins (-26.45% add, -13.62% subtract) apply to those arithmetic loops; they are not predicted TPC-H percentages. The native extension’s TPC-H reach was overestimated. Compressed counters are separate files: all22 activation counts, source/overlay metadata. The temporary diagnostic service is stopped and its disposable database clone removed. |
Completed current-head SF100 disk-backed screenCompared clean main These are valid measurements, but this SF100 screen establishes no end-to-end speedup. Paired Total wall change is +2.17% (95% CI -14.36% to +21.88%). No query or Total has a confirmed slowdown under the registered tests; none of the predeclared Q5/Q9/Q14 targets has a confirmed wall gain here. The wide intervals are inconclusive, not proof of equivalence. Overall acceptance remains pending the current-head SF10 results and target instruction evidence. All 32 local CPUs; 48 GiB application budget/no swap; 16 GiB CN shared cache; 32 GiB aggregation/join thresholds. Three alternating independent pairs, each excluding one full cold Q1-Q22 suite before one scored warm full suite. No spilling, swap, OOM, or memory-limit events in accepted runs; compiler and outside-CPU guards remained active. This is disk-backed, not all-memory. Benchmark/load scripts execute and drain SQL without row/schema/result verification.
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. Displayed rows are medians across process blocks; Total sums those per-query medians. The change/interval column instead uses paired log ratios, so it is not necessarily the ratio of the two displayed medians.
The third pair used more CPU in both arms; it is retained rather than discarded. Per-arm scored physical reads were about 170-188 GiB, consistent with a substantial disk-backed workload. Thus this result cannot isolate decimal arithmetic latency from filesystem and scheduling variation. Separate compressed evidence
All five files contain timings, resource counters, statistics and source/compiler metadata; no executable, database, or sampled stack memory. Remaining delivery workSF10 loading has completed from retained local inputs in 109.00 seconds including setup/statistics/checkpoint/shutdown. The timing preflight then detected new Cargo/Rust jobs and deferred SF10 before any scored run; the loaded image is retained and those unrelated jobs are untouched. The expression source is unchanged. Newest MO main has advanced with Top-K and service changes; this table qualifies only the explicitly pinned current PR/main pair, not a future merged head. CI#473 remains unmerged. The unrelated RC-transfer failure is tracked in #32321; the queue handoff counterexample is reported on #25590. This PR remains draft; no failed or missing acceptance criterion is waived. |
Completed current-head SF10 RAM/disk comparisonCompared clean main The registered wall-gain criterion remains unmet. Neither placement establishes a Q5/Q9/Q14 target wall gain. Neither Total nor any query has a confirmed slowdown under the approved tests. RAM Q19 is +6.60% in the raw comparison (95% CI +1.43% to +12.03%), retained below, but is not confirmed after the registered Holm correction. This is not proof of equivalence; the signal remains visible for follow-up. Absence of a confirmed regression does not replace this expression PR's separate target-gain requirement. This is consistent with the completed SF100 screen, which also established no target wall gain. Component improvements and lower CPU point estimates do not establish a whole-query latency win. SF10 RAM-backed
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. SF10 disk-backed
Total sums per-query medians. Paired changes use independent process blocks. Negative means faster. Cold suites excluded. The wall-change column uses matched process-block log ratios; displayed rows are medians across blocks and Total sums per-query medians, so changes need not equal the ratio of displayed columns. Total uses its unadjusted 95% primary interval. Query-regression confirmation uses Holm across all 22 at one-sided alpha 0.025; target-wall confirmation uses the predeclared Q5/Q9/Q14 family. No test rule was changed after viewing these results. The original completion record inherited an incorrect SF100 label from its copied harness. Source audit confirms the executed query manifest/config were SF10 and five warm suites were scored. The original label is preserved locally; published metadata records the correction. No timing samples were edited or rerun for that label correction. Separate compressed evidence
These files contain timing samples, CPU times, statistical decisions and public source/build identity. Internal paths, process identifiers and raw system snapshots are omitted. There is no executable, database or sampled stack memory. The PR remains draft. matrixorigin/CI#473 is still unmerged, and the existing UT failures remain separate blockers. Further chain fusion belongs in a following design/PR as agreed; no production source was changed for this measurement. |
fengttt
left a comment
There was a problem hiding this comment.
We should move go up to 1.27 and implement both amd64 and arm64 SIMD
What type of PR is this?
Which issue(s) this PR fixes:
Related to #30860. Broader decimal performance work remains open.
What this PR does / why we need it:
Add bounded Go AVX2 kernels to existing decimal expression paths: prepared Decimal64/128 arithmetic, native Decimal64 multiplication, fused revenue expressions, lossless Decimal64-to-Decimal128 casts, and fully checked native Decimal128 addition/subtraction. Preserve SQL types, scales, overflow diagnostics, selected-row behavior and result ownership.
Check native Decimal128 add/sub in eight-row blocks before publishing stores. Resume the scalar owner at the first untouched block to preserve the first failing row, including in-place scale alignment and constant broadcasts. Use exact scalar overflow identities and direct one-row NULL handling to reduce fallback setup. Extend independent full-range arithmetic and aliasing tests and retain the existing SQL integration case.
Design and validation
The requester approved this coverage revision before implementation. The versioned design records the contracts, qualification decisions and scalar arithmetic proof. Reduction remains independent in #32266.
Performance tables, profiles and test outcomes are recorded in comments: