Skip to content

Fix Decimal division hang and make additive arithmetic exact - #2714

Merged
jviotti merged 4 commits into
mainfrom
decimal-fixes
Aug 8, 2026
Merged

Fix Decimal division hang and make additive arithmetic exact#2714
jviotti merged 4 commits into
mainfrom
decimal-fixes

Conversation

@jviotti

@jviotti jviotti commented Aug 7, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode

augmentcode Bot commented Aug 7, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR replaces the multi-word BigCoefficient division loop with Knuth Algorithm D.
It normalizes operands, estimates quotient words, corrects overestimates, and denormalizes remainders.
The change targets division cases whose prior repeated-subtraction implementation could hang.

Changes:

  • Reworks Decimal remainder to use exact aligned big-integer division.
  • Removes working-precision rounding from big-coefficient addition and subtraction.
  • Converts signaling NaNs to quiet NaNs during float and double conversion.
  • Updates JSON overflow expectations to retain exact Decimal sums.
  • Adds coverage for multi-word division, remainder, signed zero, NaNs, and exact additive arithmetic.
Technical notes: Division now has explicit trial-word correction and add-back handling; multiplication and ordinary division retain their existing rounding behavior.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/lang/numeric/decimal.cc Outdated
}
}
}
BigCoefficient::align_exponents(dividend_big, divisor_big, this->exponent_,

@augmentcode augmentcode Bot Aug 7, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid finite input such as Decimal{"1e+2147483647"} % Decimal{1} reaches this alignment and attempts to materialize roughly 119 million base words even though its remainder is exactly zero, leading to an OOM or hang. The prior quotient-based implementation handled this case without expanding the exponent, so the new exact-modulo path is not safe across the supported exponent range.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/lang/numeric/decimal.cc Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Details
Benchmark suite Current: 43bffc9 Previous: ff5ab33 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.7732165095834187 ns/iter 2.257922187398774 ns/iter 0.79
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.5854510506336064 ns/iter 2.1875893496493037 ns/iter 0.72
Regex_Period_Asterisk 1.5705092640776455 ns/iter 2.2080714480626042 ns/iter 0.71
Regex_Group_Period_Asterisk_Group 1.5738142537416375 ns/iter 2.112699028142512 ns/iter 0.74
Regex_Period_Plus 1.9154564284444622 ns/iter 2.6853019301060006 ns/iter 0.71
Regex_Period 1.8840778053506495 ns/iter 2.869957470237814 ns/iter 0.66
Regex_Caret_Period_Plus_Dollar 1.890990871382931 ns/iter 2.594548498023744 ns/iter 0.73
Regex_Caret_Group_Period_Plus_Group_Dollar 1.884670079628712 ns/iter 2.5269619136721384 ns/iter 0.75
Regex_Caret_Period_Asterisk_Dollar 1.5686281097961943 ns/iter 2.2808550060940602 ns/iter 0.69
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.6698764866568374 ns/iter 2.3585292566367926 ns/iter 0.71
Regex_Caret_X_Hyphen 6.01454806733704 ns/iter 7.625251413563233 ns/iter 0.79
Regex_Period_Md_Dollar 15.58617952383676 ns/iter 23.150440309230092 ns/iter 0.67
Regex_Caret_Slash_Period_Asterisk 4.198106430619365 ns/iter 6.014654146147526 ns/iter 0.70
Regex_Caret_Period_Range_Dollar 1.8909421022644022 ns/iter 2.917380776415635 ns/iter 0.65
Regex_Nested_Backtrack 24.640446420247752 ns/iter 33.40532625014411 ns/iter 0.74
JSON_Array_Of_Objects_Unique 321.6803888987609 ns/iter 417.3092905665249 ns/iter 0.77
JSON_Parse_1 6088.001301939346 ns/iter 8401.115432409177 ns/iter 0.72
JSON_Parse_Real 6370.012639055266 ns/iter 8614.359057896041 ns/iter 0.74
JSON_Parse_Decimal 6924.490317761751 ns/iter 8851.756680079814 ns/iter 0.78
JSON_Parse_Schema_ISO_Language 3565076.388888934 ns/iter 5321958.333332992 ns/iter 0.67
JSON_Parse_Integer 4273.148595742988 ns/iter 6610.831254062813 ns/iter 0.65
JSON_Parse_String_NonSSO_Plain 7493.371190737037 ns/iter 10304.39076867831 ns/iter 0.73
JSON_Parse_String_SSO_Plain 2596.672806675461 ns/iter 3788.003813609092 ns/iter 0.69
JSON_Parse_String_Escape_Heavy 20786.98137119592 ns/iter 28754.492402948297 ns/iter 0.72
JSON_Parse_Object_Short_Keys 7557.173370720753 ns/iter 11027.059434202398 ns/iter 0.69
JSON_Parse_Object_Scalar_Properties 3993.9479958964444 ns/iter 5599.62939872548 ns/iter 0.71
JSON_Parse_Object_Array_Properties 6531.4176941042215 ns/iter 8744.568019310116 ns/iter 0.75
JSON_Parse_Object_Object_Properties 6829.139157917068 ns/iter 9552.47307204606 ns/iter 0.71
JSON_Parse_Nested_Containers 57475.96222827852 ns/iter 75898.549195555 ns/iter 0.76
JSON_From_String_Copy 21.33582272211656 ns/iter 27.662791491735046 ns/iter 0.77
JSON_From_String_Temporary 17.534041158371288 ns/iter 25.02242233031781 ns/iter 0.70
JSON_Number_To_Double 30.43162386953305 ns/iter 37.062477284282586 ns/iter 0.82
JSON_Object_At_Last_Key/8 3.7654674407319217 ns/iter 4.465820534328741 ns/iter 0.84
JSON_Object_At_Last_Key/32 12.539290275740335 ns/iter 12.343458586525493 ns/iter 1.02
JSON_Object_At_Last_Key/128 51.22172768326451 ns/iter 55.00266764384555 ns/iter 0.93
JSON_Object_At_Last_Key/512 186.14926437064963 ns/iter 189.459163418116 ns/iter 0.98
JSON_Fast_Hash_Helm_Chart_Lock 60.40460931084923 ns/iter 61.13633380267751 ns/iter 0.99
JSON_Equality_Helm_Chart_Lock 129.69381440425826 ns/iter 137.56347637776324 ns/iter 0.94
JSON_Divisible_By_Decimal 168.30440315633655 ns/iter 176.39689000627234 ns/iter 0.95
JSON_String_Equal/10 6.656307804901345 ns/iter 7.597020097611502 ns/iter 0.88
JSON_String_Equal/100 6.923397495970544 ns/iter 7.23559829393941 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 0.33864344627232207 ns/iter 0.3469670096796594 ns/iter 0.98
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 2.991481111971389 ns/iter 3.261859252564236 ns/iter 0.92
JSON_String_Fast_Hash/10 2.2617735722152257 ns/iter 2.3980989524610425 ns/iter 0.94
JSON_String_Fast_Hash/100 2.0899572758135494 ns/iter 2.1004675092918252 ns/iter 0.99
JSON_String_Key_Hash/10 1.6909036274857911 ns/iter 1.704840910181742 ns/iter 0.99
JSON_String_Key_Hash/100 2.0576178831824787 ns/iter 2.0617254203725834 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.5271280886278107 ns/iter 2.7257458573948563 ns/iter 0.93
JSON_Object_Defines_Miss_Too_Small 2.5118483837843 ns/iter 2.71688188480555 ns/iter 0.92
JSON_Object_Defines_Miss_Too_Large 2.5119566241658466 ns/iter 2.852719794825073 ns/iter 0.88
Pointer_Object_Traverse 21.978178355714963 ns/iter 24.226871357557826 ns/iter 0.91
Pointer_Object_Try_Traverse 20.29411469204463 ns/iter 24.678643853521404 ns/iter 0.82
Pointer_Push_Back_Pointer_To_Weak_Pointer 166.36221141374185 ns/iter 164.8877300443251 ns/iter 1.01
Pointer_Walker_Schema_ISO_Language 2486992.449664191 ns/iter 2694661.3807690656 ns/iter 0.92
Pointer_Maybe_Tracked_Deeply_Nested/0 1114884.2671998863 ns/iter 1278918.4947369073 ns/iter 0.87
Pointer_Maybe_Tracked_Deeply_Nested/1 939464.2296395653 ns/iter 1067136.6085043608 ns/iter 0.88
Pointer_Position_Tracker_Get_Deeply_Nested 365.70360446592974 ns/iter 331.0842325754267 ns/iter 1.10
JSONPath_Descendant_Filter_Nested 1272.3585071462703 ns/iter 1303.632344929835 ns/iter 0.98
URITemplateRouter_Create 21718.58354629197 ns/iter 23602.070031418316 ns/iter 0.92
URITemplateRouter_Match 157.3881871197042 ns/iter 170.8646716529174 ns/iter 0.92
URITemplateRouter_Match_BasePath 185.3123838544516 ns/iter 201.24338481882532 ns/iter 0.92
URITemplateRouterView_Restore 9474.436863280063 ns/iter 10336.07012445152 ns/iter 0.92
URITemplateRouterView_Match 125.35620520415927 ns/iter 137.77968982270647 ns/iter 0.91
URITemplateRouterView_Match_BasePath 141.78939517259258 ns/iter 155.6455144786792 ns/iter 0.91
URITemplateRouterView_Arguments 510.1779000141115 ns/iter 634.6516869594068 ns/iter 0.80
JSONL_Parse_Large 9340909.0281694 ns/iter 11375455.734375706 ns/iter 0.82
JSONL_Parse_Large_GZIP 10237510.869565679 ns/iter 12340728.807017561 ns/iter 0.83
JSONLD_Catalog_Annotation_List_Populate 931768.1771811739 ns/iter 1025540.5181422522 ns/iter 0.91
JSONLD_Catalog_Materialize 4378167.405882456 ns/iter 12633551.630435014 ns/iter 0.35
HTML_Build_Table_100000 38103673.611115284 ns/iter 60128052.08333323 ns/iter 0.63
HTML_Render_Table_100000 1431669.4335938517 ns/iter 2622856.6775243343 ns/iter 0.55
GZIP_Compress_ISO_Language_Set_3_Locations 26393721.275859393 ns/iter 31321732.95454198 ns/iter 0.84
GZIP_Decompress_ISO_Language_Set_3_Locations 3138886.436274521 ns/iter 4420673.6580646625 ns/iter 0.71
GZIP_Compress_ISO_Language_Set_3_Schema 1488798.4054671621 ns/iter 2243902.1051135133 ns/iter 0.66
GZIP_Decompress_ISO_Language_Set_3_Schema 293641.21294657345 ns/iter 353194.66020358907 ns/iter 0.83
JOSE_VerifySignature_RS256 21363.80102577983 ns/iter 30668.035626822893 ns/iter 0.70
JOSE_VerifySignature_ES512 1094660.5096685025 ns/iter 1256632.3861939246 ns/iter 0.87

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/gcc)

Details
Benchmark suite Current: 43bffc9 Previous: ff5ab33 Ratio
JOSE_VerifySignature_RS256 19300.362171821856 ns/iter 22442.722440185542 ns/iter 0.86
JOSE_VerifySignature_ES512 510787.9690000345 ns/iter 575706.5313014697 ns/iter 0.89
GZIP_Compress_ISO_Language_Set_3_Locations 30023362.21739014 ns/iter 36583857.94736468 ns/iter 0.82
GZIP_Decompress_ISO_Language_Set_3_Locations 2688940.7423075577 ns/iter 4153650.6249997276 ns/iter 0.65
GZIP_Compress_ISO_Language_Set_3_Schema 1750940.5461344856 ns/iter 2018132.158959579 ns/iter 0.87
GZIP_Decompress_ISO_Language_Set_3_Schema 195346.0434903731 ns/iter 375387.4123324703 ns/iter 0.52
HTML_Build_Table_100000 53282923.61538772 ns/iter 63381451.63636 ns/iter 0.84
HTML_Render_Table_100000 1790935.8611826983 ns/iter 1917456.3561641474 ns/iter 0.93
JSONLD_Catalog_Annotation_List_Populate 1180736.3923205226 ns/iter 1477298.3163482812 ns/iter 0.80
JSONLD_Catalog_Materialize 5328238.181818685 ns/iter 6960265.886597703 ns/iter 0.77
JSONL_Parse_Large 10155509.492753243 ns/iter 13701669.705882274 ns/iter 0.74
JSONL_Parse_Large_GZIP 11347099.193548892 ns/iter 14979298.617023 ns/iter 0.76
URITemplateRouter_Create 22249.54915383196 ns/iter 30988.61954114671 ns/iter 0.72
URITemplateRouter_Match 111.60232649721674 ns/iter 149.0445749806054 ns/iter 0.75
URITemplateRouter_Match_BasePath 134.40345511393465 ns/iter 170.4828590354445 ns/iter 0.79
URITemplateRouterView_Restore 7746.536482244121 ns/iter 8303.855791655036 ns/iter 0.93
URITemplateRouterView_Match 93.51382591848282 ns/iter 135.29710602042002 ns/iter 0.69
URITemplateRouterView_Match_BasePath 104.8975906507779 ns/iter 150.44514998368956 ns/iter 0.70
URITemplateRouterView_Arguments 367.2814089175511 ns/iter 470.96864446752716 ns/iter 0.78
JSONPath_Descendant_Filter_Nested 1393.2680629211623 ns/iter 1767.995450100058 ns/iter 0.79
Pointer_Object_Traverse 25.034255863672534 ns/iter 30.7484221648024 ns/iter 0.81
Pointer_Object_Try_Traverse 20.045940861946946 ns/iter 25.749015530138692 ns/iter 0.78
Pointer_Push_Back_Pointer_To_Weak_Pointer 128.42229913153403 ns/iter 160.67907641217369 ns/iter 0.80
Pointer_Walker_Schema_ISO_Language 2077279.1810583428 ns/iter 2509486.0553505267 ns/iter 0.83
Pointer_Maybe_Tracked_Deeply_Nested/0 1472608.2037815321 ns/iter 1859397.6584699699 ns/iter 0.79
Pointer_Maybe_Tracked_Deeply_Nested/1 1277243.1864717046 ns/iter 1719851.350490201 ns/iter 0.74
Pointer_Position_Tracker_Get_Deeply_Nested 333.6103285292097 ns/iter 423.66743658443494 ns/iter 0.79
JSON_Array_Of_Objects_Unique 334.6506212025361 ns/iter 428.48897160453527 ns/iter 0.78
JSON_Parse_1 7270.234940319524 ns/iter 9907.456319609128 ns/iter 0.73
JSON_Parse_Real 6019.728674600098 ns/iter 8103.3158102492625 ns/iter 0.74
JSON_Parse_Decimal 8674.71403040598 ns/iter 13070.057426959038 ns/iter 0.66
JSON_Parse_Schema_ISO_Language 5203639.244444747 ns/iter 6671316.146067828 ns/iter 0.78
JSON_Parse_Integer 4589.401685485072 ns/iter 5844.290177860928 ns/iter 0.79
JSON_Parse_String_NonSSO_Plain 9244.729958473818 ns/iter 12250.012018515636 ns/iter 0.75
JSON_Parse_String_SSO_Plain 3837.7032630360854 ns/iter 5135.620092066234 ns/iter 0.75
JSON_Parse_String_Escape_Heavy 19281.693950372828 ns/iter 25723.07458959449 ns/iter 0.75
JSON_Parse_Object_Short_Keys 11070.190488231874 ns/iter 13871.676388359288 ns/iter 0.80
JSON_Parse_Object_Scalar_Properties 5668.358439768071 ns/iter 7188.266933740961 ns/iter 0.79
JSON_Parse_Object_Array_Properties 9671.108633252978 ns/iter 12694.770142092686 ns/iter 0.76
JSON_Parse_Object_Object_Properties 9322.808574398117 ns/iter 12442.248983216105 ns/iter 0.75
JSON_Parse_Nested_Containers 76057.1611565687 ns/iter 100184.47293244573 ns/iter 0.76
JSON_From_String_Copy 15.014951277118323 ns/iter 17.773643241016114 ns/iter 0.84
JSON_From_String_Temporary 12.284898839805402 ns/iter 15.152501130260891 ns/iter 0.81
JSON_Number_To_Double 15.27985455705467 ns/iter 21.213683579272427 ns/iter 0.72
JSON_Object_At_Last_Key/8 5.186612837742095 ns/iter 5.614882879158651 ns/iter 0.92
JSON_Object_At_Last_Key/32 18.592128302052608 ns/iter 21.510450582343548 ns/iter 0.86
JSON_Object_At_Last_Key/128 70.94891722356434 ns/iter 87.6957922555746 ns/iter 0.81
JSON_Object_At_Last_Key/512 293.9083205496762 ns/iter 393.0381922095455 ns/iter 0.75
JSON_Fast_Hash_Helm_Chart_Lock 63.73993917563819 ns/iter 65.14853181050331 ns/iter 0.98
JSON_Equality_Helm_Chart_Lock 110.18415666036827 ns/iter 160.44471599212457 ns/iter 0.69
JSON_Divisible_By_Decimal 201.61372509385745 ns/iter 253.93535009160166 ns/iter 0.79
JSON_String_Equal/10 4.194424390242902 ns/iter 5.41808822379075 ns/iter 0.77
JSON_String_Equal/100 5.013195664832067 ns/iter 6.038010006416452 ns/iter 0.83
JSON_String_Equal_Small_By_Perfect_Hash/10 0.5543368814873592 ns/iter 0.744477462026039 ns/iter 0.74
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 17.022574768620157 ns/iter 25.196786578918292 ns/iter 0.68
JSON_String_Fast_Hash/10 2.0131887688236856 ns/iter 2.299923697287106 ns/iter 0.88
JSON_String_Fast_Hash/100 2.0131683790265806 ns/iter 2.296460236560364 ns/iter 0.88
JSON_String_Key_Hash/10 0.8448154974887381 ns/iter 1.2464077496484385 ns/iter 0.68
JSON_String_Key_Hash/100 11.448830564107064 ns/iter 12.44583263558015 ns/iter 0.92
JSON_Object_Defines_Miss_Same_Length 2.4554319053096183 ns/iter 2.8039912332122174 ns/iter 0.88
JSON_Object_Defines_Miss_Too_Small 3.0031367176708406 ns/iter 3.427712563685068 ns/iter 0.88
JSON_Object_Defines_Miss_Too_Large 2.4569540473100893 ns/iter 3.115386379749128 ns/iter 0.79
Regex_Lower_S_Or_Upper_S_Asterisk 0.5458392681849279 ns/iter 0.6236397989718351 ns/iter 0.88
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.5459321825884449 ns/iter 0.6235227668357733 ns/iter 0.88
Regex_Period_Asterisk 0.5512643822609279 ns/iter 0.6234797456448125 ns/iter 0.88
Regex_Group_Period_Asterisk_Group 0.5461117874028839 ns/iter 0.6250039753457008 ns/iter 0.87
Regex_Period_Plus 0.5458305657508328 ns/iter 0.623651578637868 ns/iter 0.88
Regex_Period 0.5483114290205148 ns/iter 0.6233470323311877 ns/iter 0.88
Regex_Caret_Period_Plus_Dollar 0.5457429092802986 ns/iter 0.6235403385967615 ns/iter 0.88
Regex_Caret_Group_Period_Plus_Group_Dollar 0.5467919052590957 ns/iter 0.6237583719982741 ns/iter 0.88
Regex_Caret_Period_Asterisk_Dollar 0.545967557794022 ns/iter 0.6232849506417415 ns/iter 0.88
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.5462670788101867 ns/iter 0.6233697756733797 ns/iter 0.88
Regex_Caret_X_Hyphen 3.000547158034535 ns/iter 3.741065051159843 ns/iter 0.80
Regex_Period_Md_Dollar 27.140607803503762 ns/iter 42.87069771546614 ns/iter 0.63
Regex_Caret_Slash_Period_Asterisk 3.001746078018329 ns/iter 4.047519286658103 ns/iter 0.74
Regex_Caret_Period_Range_Dollar 1.0910007388476763 ns/iter 1.2464749736636684 ns/iter 0.88
Regex_Nested_Backtrack 31.59852252311706 ns/iter 46.73321095267942 ns/iter 0.68

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/llvm)

Details
Benchmark suite Current: 43bffc9 Previous: ff5ab33 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.495681316530877 ns/iter 1.9055624073100834 ns/iter 1.31
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.8073281396684973 ns/iter 2.293821046766432 ns/iter 1.22
Regex_Period_Asterisk 2.8024104501120393 ns/iter 2.1550229604591773 ns/iter 1.30
Regex_Group_Period_Asterisk_Group 2.4925985269847275 ns/iter 1.9004307725846892 ns/iter 1.31
Regex_Period_Plus 3.125560828289971 ns/iter 2.0492521227929856 ns/iter 1.53
Regex_Period 3.4266562444430604 ns/iter 2.5559856243311825 ns/iter 1.34
Regex_Caret_Period_Plus_Dollar 3.4242997522327583 ns/iter 2.4784418673448094 ns/iter 1.38
Regex_Caret_Group_Period_Plus_Group_Dollar 3.1130969453733957 ns/iter 2.1809176061046363 ns/iter 1.43
Regex_Caret_Period_Asterisk_Dollar 2.92811900603042 ns/iter 1.8544969346624085 ns/iter 1.58
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.802177468072869 ns/iter 2.214944619926125 ns/iter 1.27
Regex_Caret_X_Hyphen 6.548987499426133 ns/iter 4.46810108994089 ns/iter 1.47
Regex_Period_Md_Dollar 27.535195486068183 ns/iter 18.56732958391838 ns/iter 1.48
Regex_Caret_Slash_Period_Asterisk 6.535015021295748 ns/iter 4.3739871045214995 ns/iter 1.49
Regex_Caret_Period_Range_Dollar 4.672236028151176 ns/iter 3.0224876602671653 ns/iter 1.55
Regex_Nested_Backtrack 47.814403231523464 ns/iter 28.75463459717156 ns/iter 1.66
JSON_Array_Of_Objects_Unique 415.02940093621345 ns/iter 360.3539151730649 ns/iter 1.15
JSON_Parse_1 4908.75696080453 ns/iter 3934.7770938032545 ns/iter 1.25
JSON_Parse_Real 5445.890939427344 ns/iter 4259.365498009743 ns/iter 1.28
JSON_Parse_Decimal 8311.589984833116 ns/iter 6546.081022376667 ns/iter 1.27
JSON_Parse_Schema_ISO_Language 3498186.075376569 ns/iter 2716860.3446804634 ns/iter 1.29
JSON_Parse_Integer 3923.203523009298 ns/iter 3146.973527572845 ns/iter 1.25
JSON_Parse_String_NonSSO_Plain 5184.539967566852 ns/iter 3803.27743528483 ns/iter 1.36
JSON_Parse_String_SSO_Plain 2919.1315828985466 ns/iter 2189.6763874940907 ns/iter 1.33
JSON_Parse_String_Escape_Heavy 14702.62729735803 ns/iter 11686.36990312788 ns/iter 1.26
JSON_Parse_Object_Short_Keys 10352.93882911855 ns/iter 6129.1781699626135 ns/iter 1.69
JSON_Parse_Object_Scalar_Properties 3952.4394127542587 ns/iter 3208.6975903992115 ns/iter 1.23
JSON_Parse_Object_Array_Properties 5630.7856287128525 ns/iter 4344.971233250731 ns/iter 1.30
JSON_Parse_Object_Object_Properties 5442.733004802765 ns/iter 4289.255961637723 ns/iter 1.27
JSON_Parse_Nested_Containers 45721.27889955984 ns/iter 35478.54212081372 ns/iter 1.29
JSON_From_String_Copy 20.252359660035395 ns/iter 15.994299728209963 ns/iter 1.27
JSON_From_String_Temporary 17.76001666106268 ns/iter 14.526400129508094 ns/iter 1.22
JSON_Number_To_Double 23.718133358149533 ns/iter 21.523320328123873 ns/iter 1.10
JSON_Object_At_Last_Key/8 3.827126567818922 ns/iter 3.505412474168924 ns/iter 1.09
JSON_Object_At_Last_Key/32 12.354977500564754 ns/iter 11.516102234148379 ns/iter 1.07
JSON_Object_At_Last_Key/128 49.64159316023577 ns/iter 43.88833513146808 ns/iter 1.13
JSON_Object_At_Last_Key/512 403.8007998148194 ns/iter 181.96326904249656 ns/iter 2.22
JSON_Fast_Hash_Helm_Chart_Lock 60.0494289030236 ns/iter 52.473107609344524 ns/iter 1.14
JSON_Equality_Helm_Chart_Lock 170.4643891230692 ns/iter 139.49652783420487 ns/iter 1.22
JSON_Divisible_By_Decimal 254.12442679466687 ns/iter 201.0385445769991 ns/iter 1.26
JSON_String_Equal/10 5.922625965242309 ns/iter 4.361172655307689 ns/iter 1.36
JSON_String_Equal/100 6.544079530492487 ns/iter 6.290294556542774 ns/iter 1.04
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9394301914081655 ns/iter 0.5782316695254869 ns/iter 1.62
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.926888505950833 ns/iter 8.435843546195134 ns/iter 1.77
JSON_String_Fast_Hash/10 2.799659493822189 ns/iter 2.2706164312214296 ns/iter 1.23
JSON_String_Fast_Hash/100 2.8029775278193365 ns/iter 2.3166011798989405 ns/iter 1.21
JSON_String_Key_Hash/10 2.717631090934157 ns/iter 1.7034045663840502 ns/iter 1.60
JSON_String_Key_Hash/100 9.173238823322482 ns/iter 5.937175110212244 ns/iter 1.55
JSON_Object_Defines_Miss_Same_Length 3.1361403817338123 ns/iter 3.621830593310293 ns/iter 0.87
JSON_Object_Defines_Miss_Too_Small 3.447566593684222 ns/iter 3.9694515328341775 ns/iter 0.87
JSON_Object_Defines_Miss_Too_Large 2.6210475735297663 ns/iter 3.9315327217790172 ns/iter 0.67
Pointer_Object_Traverse 28.71605839085931 ns/iter 19.57667713345666 ns/iter 1.47
Pointer_Object_Try_Traverse 31.187105651799463 ns/iter 23.525757754626348 ns/iter 1.33
Pointer_Push_Back_Pointer_To_Weak_Pointer 241.98181910446164 ns/iter 152.44825824619673 ns/iter 1.59
Pointer_Walker_Schema_ISO_Language 2600816.2344324165 ns/iter 2274071.6501545757 ns/iter 1.14
Pointer_Maybe_Tracked_Deeply_Nested/0 1227789.3121597718 ns/iter 982524.1582632157 ns/iter 1.25
Pointer_Maybe_Tracked_Deeply_Nested/1 1590338.9478456464 ns/iter 1250816.8288770155 ns/iter 1.27
Pointer_Position_Tracker_Get_Deeply_Nested 680.9786833680769 ns/iter 544.2202703866509 ns/iter 1.25
JSONPath_Descendant_Filter_Nested 1581.3875637451627 ns/iter 1102.00841843826 ns/iter 1.44
URITemplateRouter_Create 31117.095235983317 ns/iter 24043.76368295306 ns/iter 1.29
URITemplateRouter_Match 181.07908093583362 ns/iter 153.67292953738985 ns/iter 1.18
URITemplateRouter_Match_BasePath 207.1559342322527 ns/iter 170.0131046100061 ns/iter 1.22
URITemplateRouterView_Restore 8628.354062614853 ns/iter 2927.347381425842 ns/iter 2.95
URITemplateRouterView_Match 158.84094192791 ns/iter 133.73894422434267 ns/iter 1.19
URITemplateRouterView_Match_BasePath 189.33824280230576 ns/iter 157.81009674707232 ns/iter 1.20
URITemplateRouterView_Arguments 451.0038413727328 ns/iter 378.40520961608416 ns/iter 1.19
JSONL_Parse_Large 9712480.791667607 ns/iter 7545590.612902675 ns/iter 1.29
JSONL_Parse_Large_GZIP 11377223.62903281 ns/iter 8836988.240507051 ns/iter 1.29
JSONLD_Catalog_Annotation_List_Populate 1343216.143129753 ns/iter 1055099.8590505626 ns/iter 1.27
JSONLD_Catalog_Materialize 4435385.743590085 ns/iter 3536564.060301206 ns/iter 1.25
HTML_Build_Table_100000 63882419.45454741 ns/iter 56384183.54545717 ns/iter 1.13
HTML_Render_Table_100000 5400031.078124812 ns/iter 4918960.368421263 ns/iter 1.10
GZIP_Compress_ISO_Language_Set_3_Locations 32656529.61904596 ns/iter 23875412.655174527 ns/iter 1.37
GZIP_Decompress_ISO_Language_Set_3_Locations 4153139.4000003273 ns/iter 3193953.437499995 ns/iter 1.30
GZIP_Compress_ISO_Language_Set_3_Schema 1864664.534574534 ns/iter 1560438.5837102563 ns/iter 1.19
GZIP_Decompress_ISO_Language_Set_3_Schema 355696.6140172901 ns/iter 284513.83708769764 ns/iter 1.25
JOSE_VerifySignature_RS256 58224.79346557016 ns/iter 41894.52895231136 ns/iter 1.39
JOSE_VerifySignature_ES512 2411763.5275862585 ns/iter 1953238.428969373 ns/iter 1.23

This comment was automatically generated by workflow using github-action-benchmark.

jviotti added 2 commits August 7, 2026 19:05
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/lang/numeric/big_coefficient.h

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (windows/msvc)

Details
Benchmark suite Current: 43bffc9 Previous: ff5ab33 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.129799999999705 ns/iter 5.356033035714145 ns/iter 0.96
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.14878392857148 ns/iter 5.103724000000511 ns/iter 1.01
Regex_Period_Asterisk 4.9611700000014025 ns/iter 5.078186000000642 ns/iter 0.98
Regex_Group_Period_Asterisk_Group 5.074469999999565 ns/iter 5.032174999998915 ns/iter 1.01
Regex_Period_Plus 4.614315624999676 ns/iter 4.872683103765156 ns/iter 0.95
Regex_Period 4.804628571428842 ns/iter 5.14369285714216 ns/iter 0.93
Regex_Caret_Period_Plus_Dollar 4.618974787095893 ns/iter 4.823578550183393 ns/iter 0.96
Regex_Caret_Group_Period_Plus_Group_Dollar 4.794876573203304 ns/iter 5.108795535714909 ns/iter 0.94
Regex_Caret_Period_Asterisk_Dollar 5.0262610000004315 ns/iter 5.416450000000168 ns/iter 0.93
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.96442946428439 ns/iter 5.143895000001066 ns/iter 0.97
Regex_Caret_X_Hyphen 7.807437499999078 ns/iter 8.884394156767042 ns/iter 0.88
Regex_Period_Md_Dollar 55.436979999990406 ns/iter 45.05802459769109 ns/iter 1.23
Regex_Caret_Slash_Period_Asterisk 7.533072544642242 ns/iter 8.399008891074004 ns/iter 0.90
Regex_Caret_Period_Range_Dollar 5.493144642855441 ns/iter 5.99532410714281 ns/iter 0.92
Regex_Nested_Backtrack 74.42588169642558 ns/iter 55.90336000000206 ns/iter 1.33
JSON_Array_Of_Objects_Unique 800.3505580355912 ns/iter 603.8931249999483 ns/iter 1.33
JSON_Parse_1 9817.007513360673 ns/iter 8737.845366761394 ns/iter 1.12
JSON_Parse_Real 16628.87723214165 ns/iter 16092.060267856668 ns/iter 1.03
JSON_Parse_Decimal 11297.625000000979 ns/iter 12052.162500002136 ns/iter 0.94
JSON_Parse_Schema_ISO_Language 8139307.777777403 ns/iter 7603683.333334427 ns/iter 1.07
JSON_Parse_Integer 6048.037999998996 ns/iter 6153.655357142692 ns/iter 0.98
JSON_Parse_String_NonSSO_Plain 7788.390625001236 ns/iter 7849.790178572188 ns/iter 0.99
JSON_Parse_String_SSO_Plain 3747.4604509642722 ns/iter 3712.5683452872686 ns/iter 1.01
JSON_Parse_String_Escape_Heavy 21776.571875001595 ns/iter 21901.818766237746 ns/iter 0.99
JSON_Parse_Object_Short_Keys 13161.16155731181 ns/iter 13511.762499998018 ns/iter 0.97
JSON_Parse_Object_Scalar_Properties 6905.628348213051 ns/iter 6827.098214284684 ns/iter 1.01
JSON_Parse_Object_Array_Properties 11556.165624998726 ns/iter 11533.840624998958 ns/iter 1.00
JSON_Parse_Object_Object_Properties 11693.946428571118 ns/iter 11577.06964285613 ns/iter 1.01
JSON_Parse_Nested_Containers 83420.75800187758 ns/iter 79588.8839285703 ns/iter 1.05
JSON_From_String_Copy 65.88142857142185 ns/iter 64.01199107143286 ns/iter 1.03
JSON_From_String_Temporary 86.45613839285257 ns/iter 58.22323214285266 ns/iter 1.48
JSON_Number_To_Double 133.05460714288336 ns/iter 121.20895312499158 ns/iter 1.10
JSON_Object_At_Last_Key/8 7.923992187500569 ns/iter 7.22178794643012 ns/iter 1.10
JSON_Object_At_Last_Key/32 24.942182142857355 ns/iter 23.39863701563746 ns/iter 1.07
JSON_Object_At_Last_Key/128 93.97836326603999 ns/iter 90.84128165887017 ns/iter 1.03
JSON_Object_At_Last_Key/512 510.0032000000283 ns/iter 426.7219282823893 ns/iter 1.20
JSON_Fast_Hash_Helm_Chart_Lock 126.59269642857191 ns/iter 103.7719062500031 ns/iter 1.22
JSON_Equality_Helm_Chart_Lock 217.00089433031545 ns/iter 213.46415624996948 ns/iter 1.02
JSON_Divisible_By_Decimal 391.0258928572219 ns/iter 298.5251652443915 ns/iter 1.31
JSON_String_Equal/10 9.920765580709212 ns/iter 10.42227812499874 ns/iter 0.95
JSON_String_Equal/100 11.34023035714498 ns/iter 11.65638035714421 ns/iter 0.97
JSON_String_Equal_Small_By_Perfect_Hash/10 2.1427887499996245 ns/iter 2.508503571428784 ns/iter 0.85
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.851905920636531 ns/iter 15.044147321430858 ns/iter 1.05
JSON_String_Fast_Hash/10 6.842625892858223 ns/iter 6.630622321430175 ns/iter 1.03
JSON_String_Fast_Hash/100 6.564339285712809 ns/iter 6.598180803573581 ns/iter 0.99
JSON_String_Key_Hash/10 5.008910999999898 ns/iter 5.376760714284501 ns/iter 0.93
JSON_String_Key_Hash/100 11.063834375001136 ns/iter 11.882623214286728 ns/iter 0.93
JSON_Object_Defines_Miss_Same_Length 3.89410323660831 ns/iter 3.776434168206498 ns/iter 1.03
JSON_Object_Defines_Miss_Too_Small 4.4286450114471645 ns/iter 4.129967105589181 ns/iter 1.07
JSON_Object_Defines_Miss_Too_Large 3.9018214285719512 ns/iter 3.8020232074962275 ns/iter 1.03
Pointer_Object_Traverse 66.43780357141591 ns/iter 67.8180803571341 ns/iter 0.98
Pointer_Object_Try_Traverse 69.8111718749926 ns/iter 71.39916964285524 ns/iter 0.98
Pointer_Push_Back_Pointer_To_Weak_Pointer 189.2914454724466 ns/iter 171.10518333290648 ns/iter 1.11
Pointer_Walker_Schema_ISO_Language 12435928.571428737 ns/iter 12212110.714285376 ns/iter 1.02
Pointer_Maybe_Tracked_Deeply_Nested/0 2439609.0909092575 ns/iter 2507942.7966097603 ns/iter 0.97
Pointer_Maybe_Tracked_Deeply_Nested/1 3760216.4102561525 ns/iter 3789877.0053476146 ns/iter 0.99
Pointer_Position_Tracker_Get_Deeply_Nested 570.5900966819671 ns/iter 508.62688122135506 ns/iter 1.12
JSONPath_Descendant_Filter_Nested 2460.252142857858 ns/iter 2350.090569096042 ns/iter 1.05
URITemplateRouter_Create 39647.30468749725 ns/iter 40611.480744898436 ns/iter 0.98
URITemplateRouter_Match 223.41910030526628 ns/iter 235.2322812500063 ns/iter 0.95
URITemplateRouter_Match_BasePath 260.4606071428504 ns/iter 268.91792718384824 ns/iter 0.97
URITemplateRouterView_Restore 26155.204341067925 ns/iter 33662.54160221746 ns/iter 0.78
URITemplateRouterView_Match 173.4562125082281 ns/iter 181.7875073024902 ns/iter 0.95
URITemplateRouterView_Match_BasePath 200.43042185576235 ns/iter 210.17662500000256 ns/iter 0.95
URITemplateRouterView_Arguments 599.057700000003 ns/iter 544.8862999999164 ns/iter 1.10
JSONL_Parse_Large 33021980.000000894 ns/iter 32966052.380949065 ns/iter 1.00
JSONL_Parse_Large_GZIP 33605324.99999636 ns/iter 33633804.99999948 ns/iter 1.00
JSONLD_Catalog_Annotation_List_Populate 3466471.0784314214 ns/iter 3149996.2441314342 ns/iter 1.10
JSONLD_Catalog_Materialize 9853474.66666705 ns/iter 8075129.999999969 ns/iter 1.22
HTML_Build_Table_100000 94197685.71430203 ns/iter 98038371.42856407 ns/iter 0.96
HTML_Render_Table_100000 8313174.444444687 ns/iter 8264472.222223655 ns/iter 1.01
GZIP_Compress_ISO_Language_Set_3_Locations 38183752.631575294 ns/iter 35960468.4210449 ns/iter 1.06
GZIP_Decompress_ISO_Language_Set_3_Locations 11081628.124998134 ns/iter 10426156.249998542 ns/iter 1.06
GZIP_Compress_ISO_Language_Set_3_Schema 2344136.874999947 ns/iter 2105101.5624998114 ns/iter 1.11
GZIP_Decompress_ISO_Language_Set_3_Schema 605200.4464286093 ns/iter 644095.6250001153 ns/iter 0.94
JOSE_VerifySignature_RS256 23868.121428571547 ns/iter 21765.179037779457 ns/iter 1.10
JOSE_VerifySignature_ES512 1587335.9375002037 ns/iter 1397728.514056066 ns/iter 1.14

This comment was automatically generated by workflow using github-action-benchmark.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti merged commit fdee6c7 into main Aug 8, 2026
12 checks passed
@jviotti
jviotti deleted the decimal-fixes branch August 8, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant