Skip to content

Unify is_integer and is_integral across JSON and Decimal#2370

Merged
jviotti merged 3 commits into
mainfrom
decimal-symmetric-integer-semantics
May 6, 2026
Merged

Unify is_integer and is_integral across JSON and Decimal#2370
jviotti merged 3 commits into
mainfrom
decimal-symmetric-integer-semantics

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented May 6, 2026

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

No issues found across 11 files

@jviotti jviotti marked this pull request as draft May 6, 2026 19:28
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 6, 2026

🤖 Augment PR Summary

Summary: This PR aligns the meaning of is_integer vs is_integral across the JSON and Decimal number representations by separating “lexical integer literal” from “mathematically integral”.

Changes:

  • Introduces an FLAG_INTEGER_LITERAL bit to track whether a Decimal originated from an integer-lexeme (integer constructors or digit-only strings)
  • Updates Decimal::is_integer() to consult that lexical-origin flag, while keeping Decimal::is_integral() as a value-level check (e.g., 3.0 is integral)
  • Ensures float/double constructors and Decimal::strict_from(double) clear the lexical-integer flag even if stringification yields digit-only output
  • Updates integer-range predicates (is_int32/is_int64/is_uint32/is_uint64) to assert is_integral() rather than lexical is_integer()
  • Adds JSON and numeric test coverage for exponent forms, high-precision “.0” forms, big integer decimals, and integer-vs-integral expectations

Technical Notes: The new semantics make is_integer provenance-based (source form), and keep is_integral as the mathematically-correct “no fractional value” predicate.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

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

-> Integer {
assert(this->is_number());
if (this->is_integer()) {
if (this->current_type == Type::Integer) {
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 6, 2026

Choose a reason for hiding this comment

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

src/core/json/include/sourcemeta/core/json_value.h:806 (JSON::as_integer()): this asserts is_number(), but for Type::Decimal it falls into the else branch and calls to_real(), which asserts is_real() and can crash for decimal values. Consider either handling Type::Decimal explicitly or tightening the precondition so decimals aren’t accepted here.

Severity: medium

Fix This in Augment

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

[[nodiscard]] SOURCEMETA_FORCEINLINE inline auto to_integer() const noexcept
-> Integer {
assert(this->is_integer());
assert(this->current_type == Type::Integer);
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 6, 2026

Choose a reason for hiding this comment

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

src/core/json/include/sourcemeta/core/json_value.h:600 (JSON::to_integer()): after broadening is_integer() to include decimal-backed integer literals, is_integer() is no longer a safe precondition for to_integer() (which now asserts Type::Integer). Consider updating the to_integer() docs/examples so callers don’t infer the old if (is_integer()) to_integer() usage pattern.

Severity: medium

Fix This in Augment

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

/// `true` iff the value was constructed from an integer-typed constructor or
/// from a string source matching `/^-?[0-9]+$/`. Returns `false` for values
/// constructed from floating-point primitives, from strings with a fractional
/// or exponent part, or as the result of arithmetic operations.
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 6, 2026

Choose a reason for hiding this comment

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

src/lang/numeric/include/sourcemeta/core/numeric_decimal.h:127 (Decimal::is_integer() docs): the comment says values produced “as the result of arithmetic operations” return false, but some arithmetic fast-paths can early-return without modifying flags_ (e.g., adding/subtracting zero), which would preserve FLAG_INTEGER_LITERAL. If that’s intentional, the comment may need to be narrowed; otherwise callers may rely on a guarantee that doesn’t always hold.

Severity: low

Fix This in Augment

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

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

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: f26413e Previous: 8b2e478 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 3.1191421908258414 ns/iter 3.168315012956174 ns/iter 0.98
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.1134922777277505 ns/iter 3.1111099441238994 ns/iter 1.00
Regex_Period_Asterisk 3.1150520260076138 ns/iter 3.112890010614518 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 3.112238177318874 ns/iter 3.1118643816116984 ns/iter 1.00
Regex_Period_Plus 3.1016066839259935 ns/iter 3.1132058835052963 ns/iter 1.00
Regex_Period 2.9836740738943193 ns/iter 3.1117413355706804 ns/iter 0.96
Regex_Caret_Period_Plus_Dollar 3.108386768989527 ns/iter 3.1116307068962374 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 3.106461143557379 ns/iter 3.1120412005567295 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.4245945848448183 ns/iter 3.1207464483670986 ns/iter 1.10
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.422351302573195 ns/iter 3.111524658986236 ns/iter 1.10
Regex_Caret_X_Hyphen 10.275217272918683 ns/iter 6.539072475205243 ns/iter 1.57
Regex_Period_Md_Dollar 28.908735682697777 ns/iter 28.72350849144355 ns/iter 1.01
Regex_Caret_Slash_Period_Asterisk 7.162561775105152 ns/iter 6.2265822687224475 ns/iter 1.15
Regex_Caret_Period_Range_Dollar 4.047414146516019 ns/iter 4.045459314289796 ns/iter 1.00
Regex_Nested_Backtrack 49.92532802596528 ns/iter 50.258633500004635 ns/iter 0.99
JSON_Array_Of_Objects_Unique 417.00209373505675 ns/iter 423.6029486168811 ns/iter 0.98
JSON_Parse_1 5954.80049498281 ns/iter 5883.342946206924 ns/iter 1.01
JSON_Parse_Real 10586.950762713139 ns/iter 10751.17214898724 ns/iter 0.98
JSON_Parse_Decimal 11467.07569727713 ns/iter 12074.092211312009 ns/iter 0.95
JSON_Parse_Schema_ISO_Language 3710751.2093026014 ns/iter 3711284.126984417 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 58.46374851308963 ns/iter 60.37313004907881 ns/iter 0.97
JSON_Equality_Helm_Chart_Lock 155.46439417317097 ns/iter 168.9070139628799 ns/iter 0.92
JSON_Divisible_By_Decimal 257.4146520013975 ns/iter 256.35494716108167 ns/iter 1.00
JSON_String_Equal/10 5.92280377912123 ns/iter 6.857793619941182 ns/iter 0.86
JSON_String_Equal/100 6.548379747038503 ns/iter 6.555297289134322 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9362728550345666 ns/iter 0.9365067568866094 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 10.273015213345381 ns/iter 10.274711507445629 ns/iter 1.00
JSON_String_Fast_Hash/10 2.8020324204726794 ns/iter 2.8034105752204064 ns/iter 1.00
JSON_String_Fast_Hash/100 2.8135264314629245 ns/iter 2.8034048114686607 ns/iter 1.00
JSON_String_Key_Hash/10 2.152175083036068 ns/iter 2.181150039263152 ns/iter 0.99
JSON_String_Key_Hash/100 6.498637349567015 ns/iter 6.548101359794546 ns/iter 0.99
JSON_Object_Defines_Miss_Same_Length 3.7231724541963755 ns/iter 3.745647541898046 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Small 3.7276297642918528 ns/iter 3.7414821570580736 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7525591076844638 ns/iter 3.7409955361505136 ns/iter 1.00
Pointer_Object_Traverse 25.05082628304799 ns/iter 25.053879890256173 ns/iter 1.00
Pointer_Object_Try_Traverse 28.02262157505345 ns/iter 28.057206471534037 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 162.18461375541474 ns/iter 161.82989543507853 ns/iter 1.00
Pointer_Walker_Schema_ISO_Language 3051110.2086956785 ns/iter 3050729.0472100023 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/0 1387323.021956041 ns/iter 1387268.2123015632 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/1 1778619.0280611902 ns/iter 1781298.7678571306 ns/iter 1.00
Pointer_Position_Tracker_Get_Deeply_Nested 560.8752129826904 ns/iter 641.6731925660406 ns/iter 0.87
Schema_Frame_WoT_References 5244055.0923078125 ns/iter 5271713.776119383 ns/iter 0.99
Schema_Frame_OMC_References 21440354.757573638 ns/iter 21830445.156247437 ns/iter 0.98
Schema_Frame_OMC_Locations 19746833.333332207 ns/iter 20005417.5142863 ns/iter 0.99
Schema_Frame_ISO_Language_Locations 97030205.83333455 ns/iter 99510716.83334096 ns/iter 0.98
Schema_Frame_KrakenD_References 38330515.44444288 ns/iter 39307201.58823801 ns/iter 0.98
Schema_Frame_KrakenD_Reachable 543730837.999874 ns/iter 584042460.0000916 ns/iter 0.93
Schema_Iterator_ISO_Language 2955101.8828454837 ns/iter 2950712.468354436 ns/iter 1.00
Schema_Frame_ISO_Language_Locations_To_JSON 108817394.79998486 ns/iter 109197302.6000005 ns/iter 1.00
Schema_Tracker_ISO_Language 4763496.805555039 ns/iter 4934358.5070429575 ns/iter 0.97
Schema_Tracker_ISO_Language_To_JSON 18771538.94594591 ns/iter 18988115.7297307 ns/iter 0.99
Schema_Format_ISO_Language_To_JSON 102657438.7142968 ns/iter 106983081.50000457 ns/iter 0.96
Schema_Bundle_Meta_2020_12 1681771.07672879 ns/iter 1691339.075606687 ns/iter 0.99
Schema_Frame_Many_Resources_References 369912000.9999888 ns/iter 382170818.5000148 ns/iter 0.97
EditorSchema_ForEditor_EmbeddedResources 13951797.05999908 ns/iter 13930025.21999051 ns/iter 1.00
URITemplateRouter_Create 19657.6508897301 ns/iter 20131.320160596453 ns/iter 0.98
URITemplateRouter_Match 173.54699495196078 ns/iter 175.94748241740456 ns/iter 0.99
URITemplateRouter_Match_BasePath 197.03499818668377 ns/iter 198.5580831269528 ns/iter 0.99
URITemplateRouterView_Restore 5178.933413147007 ns/iter 5150.333738436592 ns/iter 1.01
URITemplateRouterView_Match 157.76699262198355 ns/iter 158.84610316901166 ns/iter 0.99
URITemplateRouterView_Match_BasePath 180.38605195237398 ns/iter 181.31453566808023 ns/iter 0.99
URITemplateRouterView_Arguments 456.8510296987771 ns/iter 464.1854814781534 ns/iter 0.98
JSONL_Parse_Large 11061852.796874661 ns/iter 10767213.107692441 ns/iter 1.03
JSONL_Parse_Large_GZIP 12151209.982454546 ns/iter 11927345.22034035 ns/iter 1.02
HTML_Build_Table_100000 62603838.81817689 ns/iter 62967750.00000501 ns/iter 0.99
HTML_Render_Table_100000 5081971.2262771465 ns/iter 5237200.059702017 ns/iter 0.97

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

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

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: f26413e Previous: 8b2e478 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.1398219063313344 ns/iter 2.86414679302624 ns/iter 0.75
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.1153290428425575 ns/iter 3.0308946344137304 ns/iter 0.70
Regex_Period_Asterisk 1.7699213802579452 ns/iter 2.799004110155359 ns/iter 0.63
Regex_Group_Period_Asterisk_Group 2.264602094293571 ns/iter 2.874598797339437 ns/iter 0.79
Regex_Period_Plus 2.3344868777619436 ns/iter 2.8358740507527442 ns/iter 0.82
Regex_Period 2.591426977024304 ns/iter 3.3975718149151724 ns/iter 0.76
Regex_Caret_Period_Plus_Dollar 2.441476173652503 ns/iter 2.8055096494835787 ns/iter 0.87
Regex_Caret_Group_Period_Plus_Group_Dollar 2.4842907726198047 ns/iter 3.0740045711797617 ns/iter 0.81
Regex_Caret_Period_Asterisk_Dollar 2.1861373793141 ns/iter 2.3794786727119805 ns/iter 0.92
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.200044382063861 ns/iter 2.3854956652291706 ns/iter 1.34
Regex_Caret_X_Hyphen 8.966286785806737 ns/iter 9.044600733433256 ns/iter 0.99
Regex_Period_Md_Dollar 34.44063206904843 ns/iter 32.38483982818344 ns/iter 1.06
Regex_Caret_Slash_Period_Asterisk 6.423739453699986 ns/iter 8.34799740239969 ns/iter 0.77
Regex_Caret_Period_Range_Dollar 2.22272784976766 ns/iter 2.5551677073177395 ns/iter 0.87
Regex_Nested_Backtrack 36.23824025979363 ns/iter 42.63642866092196 ns/iter 0.85
JSON_Array_Of_Objects_Unique 456.37772964007434 ns/iter 555.1320060403621 ns/iter 0.82
JSON_Parse_1 5942.5674878199725 ns/iter 5784.4083907666545 ns/iter 1.03
JSON_Parse_Real 8421.70991299137 ns/iter 9592.08615499599 ns/iter 0.88
JSON_Parse_Decimal 10179.69759248303 ns/iter 12004.872781068016 ns/iter 0.85
JSON_Parse_Schema_ISO_Language 4131990.1574797053 ns/iter 6040501.824562246 ns/iter 0.68
JSON_Fast_Hash_Helm_Chart_Lock 66.18434059447786 ns/iter 79.85540834782873 ns/iter 0.83
JSON_Equality_Helm_Chart_Lock 154.0032830508644 ns/iter 245.21893127240682 ns/iter 0.63
JSON_Divisible_By_Decimal 192.18403029557763 ns/iter 267.29412013245707 ns/iter 0.72
JSON_String_Equal/10 7.967537981303806 ns/iter 8.496319730349732 ns/iter 0.94
JSON_String_Equal/100 7.894813161831335 ns/iter 8.949115263210206 ns/iter 0.88
JSON_String_Equal_Small_By_Perfect_Hash/10 0.948159571009778 ns/iter 1.2876636812818436 ns/iter 0.74
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 4.4881056203871275 ns/iter 5.125741918762092 ns/iter 0.88
JSON_String_Fast_Hash/10 2.8952766976155475 ns/iter 3.7916945823365595 ns/iter 0.76
JSON_String_Fast_Hash/100 2.7577822149077402 ns/iter 3.2706849525532906 ns/iter 0.84
JSON_String_Key_Hash/10 1.5415060849330156 ns/iter 2.3770860775966716 ns/iter 0.65
JSON_String_Key_Hash/100 2.989893879083653 ns/iter 3.076701404463244 ns/iter 0.97
JSON_Object_Defines_Miss_Same_Length 2.746582702182429 ns/iter 3.419587451697678 ns/iter 0.80
JSON_Object_Defines_Miss_Too_Small 2.644941991492192 ns/iter 2.8297233776765567 ns/iter 0.93
JSON_Object_Defines_Miss_Too_Large 2.74209111177864 ns/iter 3.228648285644497 ns/iter 0.85
Pointer_Object_Traverse 15.000390988938603 ns/iter 17.699597302170766 ns/iter 0.85
Pointer_Object_Try_Traverse 24.671022696514605 ns/iter 25.463096724981433 ns/iter 0.97
Pointer_Push_Back_Pointer_To_Weak_Pointer 186.05596043327938 ns/iter 246.14066247467144 ns/iter 0.76
Pointer_Walker_Schema_ISO_Language 6491955.00000019 ns/iter 6957349.247192285 ns/iter 0.93
Pointer_Maybe_Tracked_Deeply_Nested/0 1870464.5737326741 ns/iter 1628600.2834646162 ns/iter 1.15
Pointer_Maybe_Tracked_Deeply_Nested/1 1837397.8785044958 ns/iter 2034410.3915665827 ns/iter 0.90
Pointer_Position_Tracker_Get_Deeply_Nested 446.07728029792173 ns/iter 550.2076956871122 ns/iter 0.81
Schema_Frame_WoT_References 5019938.283019115 ns/iter 7658876.795699388 ns/iter 0.66
Schema_Frame_OMC_References 32384736.68000097 ns/iter 36662585.33333651 ns/iter 0.88
Schema_Frame_OMC_Locations 30625588.32000377 ns/iter 39063530.736843616 ns/iter 0.78
Schema_Frame_ISO_Language_Locations 108475541.60000071 ns/iter 104181648.85715798 ns/iter 1.04
Schema_Frame_KrakenD_References 53517692.30769431 ns/iter 74880314.45454495 ns/iter 0.71
Schema_Frame_KrakenD_Reachable 513940790.9999818 ns/iter 674282500.9998796 ns/iter 0.76
Schema_Iterator_ISO_Language 2726826.0146340206 ns/iter 3605872.5069123106 ns/iter 0.76
Schema_Frame_ISO_Language_Locations_To_JSON 110791946.42856498 ns/iter 131385968.75000985 ns/iter 0.84
Schema_Tracker_ISO_Language 11582286.147057965 ns/iter 13192580.240742985 ns/iter 0.88
Schema_Tracker_ISO_Language_To_JSON 16305629.976191733 ns/iter 18701027.787880197 ns/iter 0.87
Schema_Format_ISO_Language_To_JSON 93866776.25002448 ns/iter 104807895.83330838 ns/iter 0.90
Schema_Bundle_Meta_2020_12 1476605.796422669 ns/iter 2035406.639465392 ns/iter 0.73
Schema_Frame_Many_Resources_References 335746395.99999046 ns/iter 586012062.5000036 ns/iter 0.57
EditorSchema_ForEditor_EmbeddedResources 11475709.531255873 ns/iter 17931072.906229418 ns/iter 0.64
URITemplateRouter_Create 17862.99569477534 ns/iter 24899.875123447746 ns/iter 0.72
URITemplateRouter_Match 166.998182135364 ns/iter 227.43712670400947 ns/iter 0.73
URITemplateRouter_Match_BasePath 226.18337478090692 ns/iter 255.4954276291344 ns/iter 0.89
URITemplateRouterView_Restore 15165.510193246777 ns/iter 22451.834720804738 ns/iter 0.68
URITemplateRouterView_Match 161.6326722792553 ns/iter 201.2419539766062 ns/iter 0.80
URITemplateRouterView_Match_BasePath 179.83510001204397 ns/iter 231.26087737589327 ns/iter 0.78
URITemplateRouterView_Arguments 541.591054955071 ns/iter 554.6957499998371 ns/iter 0.98
JSONL_Parse_Large 16633110.808509221 ns/iter 17456561.18750105 ns/iter 0.95
JSONL_Parse_Large_GZIP 14227868.386363048 ns/iter 18278444.444446348 ns/iter 0.78
HTML_Build_Table_100000 87395425.88888425 ns/iter 102905013.83334078 ns/iter 0.85
HTML_Render_Table_100000 5553070.133802822 ns/iter 6183904.76785789 ns/iter 0.90

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

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

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: f26413e Previous: 8b2e478 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 4.105264784117637 ns/iter 3.0622753753633916 ns/iter 1.34
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 4.7106776573013205 ns/iter 3.449211556340546 ns/iter 1.37
Regex_Period_Asterisk 4.0868483108687315 ns/iter 3.240967036313664 ns/iter 1.26
Regex_Group_Period_Asterisk_Group 4.71972121589181 ns/iter 3.253583442583765 ns/iter 1.45
Regex_Period_Plus 3.7696794575537287 ns/iter 2.6340574999997965 ns/iter 1.43
Regex_Period 3.7666752232150866 ns/iter 2.626171381583014 ns/iter 1.43
Regex_Caret_Period_Plus_Dollar 4.835220625000147 ns/iter 2.914417766556277 ns/iter 1.66
Regex_Caret_Group_Period_Plus_Group_Dollar 4.57782456379034 ns/iter 2.914330579055668 ns/iter 1.57
Regex_Caret_Period_Asterisk_Dollar 4.748616675166805 ns/iter 3.2122710987695475 ns/iter 1.48
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.757553358833197 ns/iter 3.20571696428524 ns/iter 1.48
Regex_Caret_X_Hyphen 8.150019606475045 ns/iter 6.455531249999678 ns/iter 1.26
Regex_Period_Md_Dollar 35.84521225997164 ns/iter 30.298348214289817 ns/iter 1.18
Regex_Caret_Slash_Period_Asterisk 8.036402901784154 ns/iter 6.399216071429237 ns/iter 1.26
Regex_Caret_Period_Range_Dollar 4.76965447493283 ns/iter 3.6807032077129502 ns/iter 1.30
Regex_Nested_Backtrack 95.76337072483342 ns/iter 91.18751378625512 ns/iter 1.05
JSON_Array_Of_Objects_Unique 518.9357631552544 ns/iter 397.9444656043591 ns/iter 1.30
JSON_Parse_1 8322.684151786625 ns/iter 7745.9999999999045 ns/iter 1.07
JSON_Parse_Real 17361.149553570347 ns/iter 14449.772992084429 ns/iter 1.20
JSON_Parse_Decimal 16109.979910718306 ns/iter 15220.171874997643 ns/iter 1.06
JSON_Parse_Schema_ISO_Language 6108594.642857464 ns/iter 6992092.222223315 ns/iter 0.87
JSON_Fast_Hash_Helm_Chart_Lock 71.866508928561 ns/iter 50.71067999999741 ns/iter 1.42
JSON_Equality_Helm_Chart_Lock 252.42289285716066 ns/iter 229.87216184463477 ns/iter 1.10
JSON_Divisible_By_Decimal 251.09521428573447 ns/iter 275.2405993196005 ns/iter 0.91
JSON_String_Equal/10 12.362862500002134 ns/iter 9.433770493599768 ns/iter 1.31
JSON_String_Equal/100 12.931953290481163 ns/iter 11.384739062499705 ns/iter 1.14
JSON_String_Equal_Small_By_Perfect_Hash/10 1.8938555374057973 ns/iter 1.4548258922075323 ns/iter 1.30
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 12.746692857145295 ns/iter 9.65664531249999 ns/iter 1.32
JSON_String_Fast_Hash/10 3.79106082589255 ns/iter 2.644390600316951 ns/iter 1.43
JSON_String_Fast_Hash/100 3.8013208860696484 ns/iter 2.633497857142889 ns/iter 1.44
JSON_String_Key_Hash/10 3.8255502232154015 ns/iter 2.6840424999997077 ns/iter 1.43
JSON_String_Key_Hash/100 16.653665178572346 ns/iter 13.726687438719297 ns/iter 1.21
JSON_Object_Defines_Miss_Same_Length 3.8094230289118434 ns/iter 4.090749471590294 ns/iter 0.93
JSON_Object_Defines_Miss_Too_Small 3.79627622767918 ns/iter 3.5087971812347756 ns/iter 1.08
JSON_Object_Defines_Miss_Too_Large 3.851099457407894 ns/iter 3.715471600508353 ns/iter 1.04
Pointer_Object_Traverse 40.264308574977804 ns/iter 36.77529041473626 ns/iter 1.09
Pointer_Object_Try_Traverse 49.33285999998134 ns/iter 49.206550000008065 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 176.793214963861 ns/iter 181.04064116437175 ns/iter 0.98
Pointer_Walker_Schema_ISO_Language 11661496.428571029 ns/iter 12375267.85714392 ns/iter 0.94
Pointer_Maybe_Tracked_Deeply_Nested/0 2007318.3946489892 ns/iter 2185764.7727265637 ns/iter 0.92
Pointer_Maybe_Tracked_Deeply_Nested/1 3261399.9999998044 ns/iter 3971256.9230768844 ns/iter 0.82
Pointer_Position_Tracker_Get_Deeply_Nested 643.5421874998935 ns/iter 529.5269391017624 ns/iter 1.22
Schema_Frame_WoT_References 10074835.937501803 ns/iter 9613613.33333419 ns/iter 1.05
Schema_Frame_OMC_References 43988337.499996535 ns/iter 42844233.333335064 ns/iter 1.03
Schema_Frame_OMC_Locations 42318017.64705565 ns/iter 39556741.17647129 ns/iter 1.07
Schema_Frame_ISO_Language_Locations 204137899.99997792 ns/iter 184076525.00002313 ns/iter 1.11
Schema_Frame_KrakenD_References 92521014.28572652 ns/iter 82909599.99999359 ns/iter 1.12
Schema_Frame_KrakenD_Reachable 556479799.9998064 ns/iter 603169500.0001491 ns/iter 0.92
Schema_Iterator_ISO_Language 6928837.7777790325 ns/iter 6607661.60714437 ns/iter 1.05
Schema_Frame_ISO_Language_Locations_To_JSON 302740200.00001657 ns/iter 291351599.9999845 ns/iter 1.04
Schema_Tracker_ISO_Language 16962236.585369483 ns/iter 17426819.512193993 ns/iter 0.97
Schema_Tracker_ISO_Language_To_JSON 50666950.000004366 ns/iter 51043220.00001957 ns/iter 0.99
Schema_Format_ISO_Language_To_JSON 201678299.99998808 ns/iter 183333575.00000602 ns/iter 1.10
Schema_Bundle_Meta_2020_12 2904370.762705331 ns/iter 2783994.0677913316 ns/iter 1.04
Schema_Frame_Many_Resources_References 1548352299.999806 ns/iter 1410759600.0001194 ns/iter 1.10
EditorSchema_ForEditor_EmbeddedResources 29183364.000009533 ns/iter 26174946.428601027 ns/iter 1.11
URITemplateRouter_Create 24963.24285713821 ns/iter 23064.28164864261 ns/iter 1.08
URITemplateRouter_Match 214.58278125003005 ns/iter 228.28906249998226 ns/iter 0.94
URITemplateRouter_Match_BasePath 252.13921428571342 ns/iter 258.03557401943533 ns/iter 0.98
URITemplateRouterView_Restore 31303.678571431094 ns/iter 24312.049999999937 ns/iter 1.29
URITemplateRouterView_Match 170.3127658691445 ns/iter 162.69238839287578 ns/iter 1.05
URITemplateRouterView_Match_BasePath 203.40704449071782 ns/iter 185.6292487169004 ns/iter 1.10
URITemplateRouterView_Arguments 447.27406249990054 ns/iter 411.51688796021347 ns/iter 1.09
JSONL_Parse_Large 28512345.83332977 ns/iter 27230563.99999223 ns/iter 1.05
JSONL_Parse_Large_GZIP 28061748.000000082 ns/iter 27045707.692309406 ns/iter 1.04
HTML_Build_Table_100000 86991766.6666677 ns/iter 93711428.57142851 ns/iter 0.93
HTML_Render_Table_100000 7882273.333335535 ns/iter 12003370.312498873 ns/iter 0.66

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

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

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: f26413e Previous: 8b2e478 Ratio
HTML_Build_Table_100000 57924222.166680776 ns/iter 63512629.54546077 ns/iter 0.91
HTML_Render_Table_100000 4675958.381579005 ns/iter 5357395.232559336 ns/iter 0.87
JSONL_Parse_Large 9743361.277776962 ns/iter 13065741.166668784 ns/iter 0.75
JSONL_Parse_Large_GZIP 10692974.530301895 ns/iter 14177826.142857306 ns/iter 0.75
URITemplateRouter_Create 12989.201446376992 ns/iter 17752.845073634424 ns/iter 0.73
URITemplateRouter_Match 127.45958296489148 ns/iter 168.4569178682907 ns/iter 0.76
URITemplateRouter_Match_BasePath 149.93584394219948 ns/iter 195.147370677737 ns/iter 0.77
URITemplateRouterView_Restore 4996.214037456906 ns/iter 6769.349893520898 ns/iter 0.74
URITemplateRouterView_Match 96.83388043119905 ns/iter 133.2657645240849 ns/iter 0.73
URITemplateRouterView_Match_BasePath 110.1235375443948 ns/iter 150.88020705559853 ns/iter 0.73
URITemplateRouterView_Arguments 371.4715913584096 ns/iter 453.6343098713122 ns/iter 0.82
EditorSchema_ForEditor_EmbeddedResources 10855025.584623946 ns/iter 13981752.140016396 ns/iter 0.78
Schema_Frame_WoT_References 4326433.876543226 ns/iter 5388923.900000009 ns/iter 0.80
Schema_Frame_OMC_References 18353215.552631233 ns/iter 22083233.031253256 ns/iter 0.83
Schema_Frame_OMC_Locations 16998672.341465063 ns/iter 20552627.382351283 ns/iter 0.83
Schema_Frame_ISO_Language_Locations 81335760.49999647 ns/iter 103336500.83335519 ns/iter 0.79
Schema_Frame_KrakenD_References 34908103.850000314 ns/iter 39549346.70589276 ns/iter 0.88
Schema_Frame_KrakenD_Reachable 485604944.9999773 ns/iter 503056833.0000733 ns/iter 0.97
Schema_Iterator_ISO_Language 2543188.9175633257 ns/iter 3266987.362791084 ns/iter 0.78
Schema_Frame_ISO_Language_Locations_To_JSON 201995640.50000164 ns/iter 220185482.33336332 ns/iter 0.92
Schema_Tracker_ISO_Language 3837122.088397794 ns/iter 4851139.801370327 ns/iter 0.79
Schema_Tracker_ISO_Language_To_JSON 17596438.549998082 ns/iter 22766756.290322166 ns/iter 0.77
Schema_Format_ISO_Language_To_JSON 89517922.75001936 ns/iter 107841671.99994953 ns/iter 0.83
Schema_Bundle_Meta_2020_12 1398690.0139962018 ns/iter 1815700.8311721836 ns/iter 0.77
Schema_Frame_Many_Resources_References 311770160.99991304 ns/iter 375176122.4999654 ns/iter 0.83
Pointer_Object_Traverse 20.67294755681931 ns/iter 25.067798186865748 ns/iter 0.82
Pointer_Object_Try_Traverse 17.32801250283147 ns/iter 19.756036294387854 ns/iter 0.88
Pointer_Push_Back_Pointer_To_Weak_Pointer 103.21636598277858 ns/iter 164.5406307932423 ns/iter 0.63
Pointer_Walker_Schema_ISO_Language 2914005.9047617363 ns/iter 3339774.49282281 ns/iter 0.87
Pointer_Maybe_Tracked_Deeply_Nested/0 1193247.4635416826 ns/iter 1561747.2331837337 ns/iter 0.76
Pointer_Maybe_Tracked_Deeply_Nested/1 1356599.748047138 ns/iter 1770165.0537087969 ns/iter 0.77
Pointer_Position_Tracker_Get_Deeply_Nested 369.10383851535113 ns/iter 497.20140163032835 ns/iter 0.74
JSON_Array_Of_Objects_Unique 322.05102834903437 ns/iter 436.108592848756 ns/iter 0.74
JSON_Parse_1 6144.155749230399 ns/iter 8157.868368000693 ns/iter 0.75
JSON_Parse_Real 9306.851066638254 ns/iter 12371.439496285755 ns/iter 0.75
JSON_Parse_Decimal 12541.275866443992 ns/iter 17483.143259479988 ns/iter 0.72
JSON_Parse_Schema_ISO_Language 3676214.015789762 ns/iter 4619391.092105436 ns/iter 0.80
JSON_Fast_Hash_Helm_Chart_Lock 55.84859850706963 ns/iter 74.6747999577773 ns/iter 0.75
JSON_Equality_Helm_Chart_Lock 136.88903004264097 ns/iter 178.1555586598616 ns/iter 0.77
JSON_Divisible_By_Decimal 182.99898226684004 ns/iter 247.2624861955372 ns/iter 0.74
JSON_String_Equal/10 5.020845980676642 ns/iter 6.7060850204719005 ns/iter 0.75
JSON_String_Equal/100 6.383903673848472 ns/iter 7.311519352479714 ns/iter 0.87
JSON_String_Equal_Small_By_Perfect_Hash/10 0.5511823229510144 ns/iter 0.6245192282382281 ns/iter 0.88
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 17.080216610559955 ns/iter 25.210642873816976 ns/iter 0.68
JSON_String_Fast_Hash/10 1.4013560005879444 ns/iter 1.5584641944631934 ns/iter 0.90
JSON_String_Fast_Hash/100 1.3642190788450224 ns/iter 1.558135407471501 ns/iter 0.88
JSON_String_Key_Hash/10 0.8416256702778652 ns/iter 1.2464384738153669 ns/iter 0.68
JSON_String_Key_Hash/100 11.4927483697416 ns/iter 12.440660168923154 ns/iter 0.92
JSON_Object_Defines_Miss_Same_Length 2.7287359720149804 ns/iter 3.4366170019040214 ns/iter 0.79
JSON_Object_Defines_Miss_Too_Small 2.7276542215402126 ns/iter 3.7344386023696337 ns/iter 0.73
JSON_Object_Defines_Miss_Too_Large 2.7365304421114995 ns/iter 3.1133747286090663 ns/iter 0.88
Regex_Lower_S_Or_Upper_S_Asterisk 1.0926137441097619 ns/iter 1.2463046260887793 ns/iter 0.88
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.0916575248389626 ns/iter 1.246152767029202 ns/iter 0.88
Regex_Period_Asterisk 1.0918359830782296 ns/iter 1.5576743882558342 ns/iter 0.70
Regex_Group_Period_Asterisk_Group 1.36407711335942 ns/iter 1.5567771361641078 ns/iter 0.88
Regex_Period_Plus 1.091459169596186 ns/iter 1.246472095826272 ns/iter 0.88
Regex_Period 1.092947129230506 ns/iter 1.246090356678059 ns/iter 0.88
Regex_Caret_Period_Plus_Dollar 1.0920900096416584 ns/iter 1.5558296406230288 ns/iter 0.70
Regex_Caret_Group_Period_Plus_Group_Dollar 1.0921446448799454 ns/iter 1.556599777094566 ns/iter 0.70
Regex_Caret_Period_Asterisk_Dollar 1.3662347767071723 ns/iter 1.5576255273995503 ns/iter 0.88
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.364535558754649 ns/iter 1.5569426813385447 ns/iter 0.88
Regex_Caret_X_Hyphen 8.724567933198335 ns/iter 12.750144783317316 ns/iter 0.68
Regex_Period_Md_Dollar 27.876346996282802 ns/iter 36.973756226087836 ns/iter 0.75
Regex_Caret_Slash_Period_Asterisk 8.451548295555927 ns/iter 4.982809672716873 ns/iter 1.70
Regex_Caret_Period_Range_Dollar 1.3644049792745896 ns/iter 1.5583539729796496 ns/iter 0.88
Regex_Nested_Backtrack 42.61241947340345 ns/iter 53.343126662797154 ns/iter 0.80

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti marked this pull request as ready for review May 6, 2026 20:13
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

No issues found across 6 files

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

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/include/sourcemeta/core/numeric_decimal.h Outdated
@jviotti jviotti merged commit 19439f7 into main May 6, 2026
13 checks passed
@jviotti jviotti deleted the decimal-symmetric-integer-semantics branch May 6, 2026 20:30
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