close
Skip to content

Decide is_regex_ecma against the ECMA-262 grammar instead of PCRE2 - #2760

Merged
jviotti merged 2 commits into
mainfrom
regex-fixes-ecma
Aug 19, 2026
Merged

Decide is_regex_ecma against the ECMA-262 grammar instead of PCRE2#2760
jviotti merged 2 commits into
mainfrom
regex-fixes-ecma

Conversation

@jviotti

@jviotti jviotti commented Aug 19, 2026

Copy link
Copy Markdown
Member

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

Review in cubic

@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: 1e0c14d Previous: 18745f9 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.8491469574535906 ns/iter 1.8909568539478596 ns/iter 0.98
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.845075185318722 ns/iter 1.8929957026439583 ns/iter 0.97
Regex_Period_Asterisk 1.7669654408735727 ns/iter 2.121103581456034 ns/iter 0.83
Regex_Group_Period_Asterisk_Group 1.8283077895283788 ns/iter 2.0937481016902617 ns/iter 0.87
Regex_Period_Plus 2.157074656073427 ns/iter 2.8032535815977586 ns/iter 0.77
Regex_Period 2.092043797698178 ns/iter 2.7901984948595153 ns/iter 0.75
Regex_Caret_Period_Plus_Dollar 2.125996985964911 ns/iter 2.290997756643229 ns/iter 0.93
Regex_Caret_Group_Period_Plus_Group_Dollar 2.155655170539964 ns/iter 2.290974005830132 ns/iter 0.94
Regex_Caret_Period_Asterisk_Dollar 1.9103862759147638 ns/iter 1.7161356305210278 ns/iter 1.11
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.7938484479896775 ns/iter 1.8347451066614855 ns/iter 0.98
Regex_Caret_X_Hyphen 6.284542323246422 ns/iter 6.285265273185 ns/iter 1.00
Regex_Period_Md_Dollar 17.569643660258123 ns/iter 18.66341592390282 ns/iter 0.94
Regex_Caret_Slash_Period_Asterisk 5.219556561315497 ns/iter 5.024791250000362 ns/iter 1.04
Regex_Caret_Period_Range_Dollar 2.1652677551244364 ns/iter 2.21993168358975 ns/iter 0.98
Regex_Nested_Backtrack 31.157009176753814 ns/iter 28.10900544355558 ns/iter 1.11
JSON_Array_Of_Objects_Unique 406.53522012380733 ns/iter 402.38251962753145 ns/iter 1.01
JSON_Parse_1 3273.5249107465215 ns/iter 3351.090074024794 ns/iter 0.98
JSON_Parse_Real 5406.515053857485 ns/iter 6087.013159822721 ns/iter 0.89
JSON_Parse_Decimal 5879.044965439758 ns/iter 7023.752643090714 ns/iter 0.84
JSON_Parse_Schema_ISO_Language 2426200.221122116 ns/iter 2694315.125984214 ns/iter 0.90
JSON_Parse_Integer 3432.0769219252716 ns/iter 4240.9022177421375 ns/iter 0.81
JSON_Parse_String_NonSSO_Plain 3706.884601867417 ns/iter 3641.787285766044 ns/iter 1.02
JSON_Parse_String_SSO_Plain 1991.6777399502762 ns/iter 2013.5396957068558 ns/iter 0.99
JSON_Parse_String_Escape_Heavy 18359.903029799287 ns/iter 23493.059866825814 ns/iter 0.78
JSON_Parse_Object_Short_Keys 5639.175576358402 ns/iter 7753.3925289552835 ns/iter 0.73
JSON_Parse_Object_Scalar_Properties 2869.5739681577875 ns/iter 4156.209879101807 ns/iter 0.69
JSON_Parse_Object_Array_Properties 3455.468728246981 ns/iter 6076.669536533713 ns/iter 0.57
JSON_Parse_Object_Object_Properties 3640.1183830655036 ns/iter 5745.539009905497 ns/iter 0.63
JSON_Parse_Nested_Containers 25655.590992108137 ns/iter 46058.0492205163 ns/iter 0.56
JSON_From_String_Copy 11.43825958032112 ns/iter 19.54946234188904 ns/iter 0.59
JSON_From_String_Temporary 6.636191943121606 ns/iter 10.362344981477767 ns/iter 0.64
JSON_Number_To_Double 37.17652235567559 ns/iter 49.8795655283278 ns/iter 0.75
JSON_Object_At_Last_Key/8 4.16956809109767 ns/iter 5.2849144591461785 ns/iter 0.79
JSON_Object_At_Last_Key/32 12.823321393300073 ns/iter 16.70894984125618 ns/iter 0.77
JSON_Object_At_Last_Key/128 59.08938240627653 ns/iter 87.24948706320912 ns/iter 0.68
JSON_Object_At_Last_Key/512 200.59646931579115 ns/iter 250.61930118711658 ns/iter 0.80
JSON_Fast_Hash_Helm_Chart_Lock 60.75004451657544 ns/iter 77.33492947648149 ns/iter 0.79
JSON_Equality_Helm_Chart_Lock 170.42950900686347 ns/iter 244.712994219622 ns/iter 0.70
JSON_Divisible_By_Decimal 182.42128015383497 ns/iter 263.11246021951183 ns/iter 0.69
JSON_String_Equal/10 6.884464598991759 ns/iter 9.31174606406114 ns/iter 0.74
JSON_String_Equal/100 6.636676401871958 ns/iter 9.41909632541854 ns/iter 0.70
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3460904219320483 ns/iter 0.4190939223244202 ns/iter 0.83
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.3730837592947194 ns/iter 4.15079126685452 ns/iter 0.81
JSON_String_Fast_Hash/10 2.391635586633629 ns/iter 3.2764733029936735 ns/iter 0.73
JSON_String_Fast_Hash/100 2.2103980711605913 ns/iter 3.0051839328772663 ns/iter 0.74
JSON_String_Key_Hash/10 1.9362649460652612 ns/iter 2.0670886191103666 ns/iter 0.94
JSON_String_Key_Hash/100 2.3526304060337155 ns/iter 2.9116242902186062 ns/iter 0.81
JSON_Object_Defines_Miss_Same_Length 2.804969657619487 ns/iter 3.2519444588483846 ns/iter 0.86
JSON_Object_Defines_Miss_Too_Small 2.707523748557374 ns/iter 3.1096765930034804 ns/iter 0.87
JSON_Object_Defines_Miss_Too_Large 2.7691513276239736 ns/iter 3.0085593036676817 ns/iter 0.92
Pointer_Object_Traverse 19.54205440482108 ns/iter 26.258999676167907 ns/iter 0.74
Pointer_Object_Try_Traverse 30.401158373010038 ns/iter 33.73104966542171 ns/iter 0.90
Pointer_Push_Back_Pointer_To_Weak_Pointer 135.1016222079525 ns/iter 151.3741378301843 ns/iter 0.89
Pointer_Walker_Schema_ISO_Language 1340169.051282161 ns/iter 1212050.110132118 ns/iter 1.11
Pointer_Maybe_Tracked_Deeply_Nested/0 885737.982121566 ns/iter 831677.1653544932 ns/iter 1.07
Pointer_Maybe_Tracked_Deeply_Nested/1 1176252.3265651723 ns/iter 1337718.1991644392 ns/iter 0.88
Pointer_Position_Tracker_Get_Deeply_Nested 489.7394947254334 ns/iter 360.38863583283484 ns/iter 1.36
JSONPath_Descendant_Filter_Nested 1416.0782691600314 ns/iter 1215.1743702514943 ns/iter 1.17
URITemplateRouter_Create 26348.415184743397 ns/iter 19803.396970872665 ns/iter 1.33
URITemplateRouter_Match 223.78703170212142 ns/iter 182.73881015369685 ns/iter 1.22
URITemplateRouter_Match_BasePath 294.9508842846384 ns/iter 209.49230613986342 ns/iter 1.41
URITemplateRouterView_Restore 16625.35148734636 ns/iter 12343.30784377362 ns/iter 1.35
URITemplateRouterView_Match 177.05230303911483 ns/iter 161.15421826526642 ns/iter 1.10
URITemplateRouterView_Match_BasePath 165.46944288258894 ns/iter 167.32312742439268 ns/iter 0.99
URITemplateRouterView_Arguments 557.7837715705381 ns/iter 564.9687466360625 ns/iter 0.99
JSONL_Parse_Large 6357871.621622171 ns/iter 6890725.215518206 ns/iter 0.92
JSONL_Parse_Large_GZIP 7331816.406249913 ns/iter 8780694.117646871 ns/iter 0.83
JSONLD_Catalog_Annotation_List_Populate 466640.5821917454 ns/iter 549025.6597761179 ns/iter 0.85
JSONLD_Catalog_Materialize 2093010.081850619 ns/iter 2710807.7415735177 ns/iter 0.77
HTML_Build_Table_100000 36178630.92857273 ns/iter 39917214.28571639 ns/iter 0.91
HTML_Render_Table_100000 1429477.7204083533 ns/iter 1980361.70074846 ns/iter 0.72
GZIP_Compress_ISO_Language_Set_3_Locations 24806900.32142872 ns/iter 32947950.772722837 ns/iter 0.75
GZIP_Decompress_ISO_Language_Set_3_Locations 3510892.1708534635 ns/iter 3740718.870588299 ns/iter 0.94
GZIP_Compress_ISO_Language_Set_3_Schema 1572855.097561117 ns/iter 1623799.3962261113 ns/iter 0.97
GZIP_Decompress_ISO_Language_Set_3_Schema 293844.93901932216 ns/iter 280072.70512820524 ns/iter 1.05
JOSE_VerifySignature_RS256 22371.78375089774 ns/iter 22525.437443916016 ns/iter 0.99
JOSE_VerifySignature_ES512 963745.2098931826 ns/iter 1007493.7524751775 ns/iter 0.96

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: 1cfbf4d Previous: 9ba55aa Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.493908612041067 ns/iter 2.201476736237156 ns/iter 1.13
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.4627474639323013 ns/iter 2.1792334500584483 ns/iter 1.13
Regex_Period_Asterisk 2.4653698488420512 ns/iter 2.1861609692676933 ns/iter 1.13
Regex_Group_Period_Asterisk_Group 2.4626944999882228 ns/iter 2.181396901866417 ns/iter 1.13
Regex_Period_Plus 3.9152365647521106 ns/iter 2.8035894906118632 ns/iter 1.40
Regex_Period 3.8672722682591663 ns/iter 2.804435082616266 ns/iter 1.38
Regex_Caret_Period_Plus_Dollar 3.868954304891258 ns/iter 2.803631780275002 ns/iter 1.38
Regex_Caret_Group_Period_Plus_Group_Dollar 3.874709244629069 ns/iter 2.8045521560206623 ns/iter 1.38
Regex_Caret_Period_Asterisk_Dollar 2.462287331800124 ns/iter 3.4318020676951932 ns/iter 0.72
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.463543579549532 ns/iter 3.424354462619152 ns/iter 0.72
Regex_Caret_X_Hyphen 6.679833598376658 ns/iter 7.166530293130413 ns/iter 0.93
Regex_Period_Md_Dollar 26.348015498094355 ns/iter 27.584628872080344 ns/iter 0.96
Regex_Caret_Slash_Period_Asterisk 7.149015246386226 ns/iter 5.603889136547636 ns/iter 1.28
Regex_Caret_Period_Range_Dollar 3.867999333640545 ns/iter 3.423818472743306 ns/iter 1.13
Regex_Nested_Backtrack 38.60778333566498 ns/iter 40.71244697842946 ns/iter 0.95
JSON_Array_Of_Objects_Unique 476.15837716117477 ns/iter 430.576750556034 ns/iter 1.11
JSON_Parse_1 4318.48989870988 ns/iter 4799.668366940876 ns/iter 0.90
JSON_Parse_Real 5224.111885190997 ns/iter 5168.103809756494 ns/iter 1.01
JSON_Parse_Decimal 7700.304068030186 ns/iter 7655.737390771504 ns/iter 1.01
JSON_Parse_Schema_ISO_Language 3305125.2877358384 ns/iter 3340441.6761901043 ns/iter 0.99
JSON_Parse_Integer 3811.4747941737796 ns/iter 3728.562746537056 ns/iter 1.02
JSON_Parse_String_NonSSO_Plain 3053.3237973927953 ns/iter 3057.681927254052 ns/iter 1.00
JSON_Parse_String_SSO_Plain 2634.9682418154816 ns/iter 2716.2309657859028 ns/iter 0.97
JSON_Parse_String_Escape_Heavy 13028.373534991415 ns/iter 12372.527805703963 ns/iter 1.05
JSON_Parse_Object_Short_Keys 7905.367107724989 ns/iter 8227.509313333243 ns/iter 0.96
JSON_Parse_Object_Scalar_Properties 4008.311488890132 ns/iter 4182.248507948182 ns/iter 0.96
JSON_Parse_Object_Array_Properties 5568.465044092522 ns/iter 5694.557830465579 ns/iter 0.98
JSON_Parse_Object_Object_Properties 5596.977992881588 ns/iter 5407.529182281788 ns/iter 1.04
JSON_Parse_Nested_Containers 34740.02185440298 ns/iter 35423.56770991399 ns/iter 0.98
JSON_From_String_Copy 14.36906629102963 ns/iter 11.645403128522778 ns/iter 1.23
JSON_From_String_Temporary 11.541149628875432 ns/iter 10.545545146920322 ns/iter 1.09
JSON_Number_To_Double 22.88100910380667 ns/iter 23.886087809481538 ns/iter 0.96
JSON_Object_At_Last_Key/8 4.0347130708814865 ns/iter 6.009263295464423 ns/iter 0.67
JSON_Object_At_Last_Key/32 13.056057608245242 ns/iter 21.5453254652663 ns/iter 0.61
JSON_Object_At_Last_Key/128 46.82384584234835 ns/iter 87.96095469658988 ns/iter 0.53
JSON_Object_At_Last_Key/512 351.23583715962735 ns/iter 396.93487751340973 ns/iter 0.88
JSON_Fast_Hash_Helm_Chart_Lock 84.02179657727464 ns/iter 68.43405704984971 ns/iter 1.23
JSON_Equality_Helm_Chart_Lock 156.7390240081976 ns/iter 168.365253619315 ns/iter 0.93
JSON_Divisible_By_Decimal 251.57384075467283 ns/iter 246.9143056593371 ns/iter 1.02
JSON_String_Equal/10 5.62735690606119 ns/iter 5.923244793683606 ns/iter 0.95
JSON_String_Equal/100 6.331228812349934 ns/iter 6.567234989940216 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 1.0544013498837264 ns/iter 0.935866373516529 ns/iter 1.13
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 12.392653190008907 ns/iter 14.631779106728201 ns/iter 0.85
JSON_String_Fast_Hash/10 3.165672266517798 ns/iter 2.4886464690152295 ns/iter 1.27
JSON_String_Fast_Hash/100 3.165637896659156 ns/iter 2.4939667339679956 ns/iter 1.27
JSON_String_Key_Hash/10 2.4631204723032845 ns/iter 2.664006493607368 ns/iter 0.92
JSON_String_Key_Hash/100 7.7778385059761606 ns/iter 9.026624886032138 ns/iter 0.86
JSON_Object_Defines_Miss_Same_Length 4.232819753255052 ns/iter 2.7979921093704916 ns/iter 1.51
JSON_Object_Defines_Miss_Too_Small 3.2130384764287405 ns/iter 2.7485920676267854 ns/iter 1.17
JSON_Object_Defines_Miss_Too_Large 2.96420075006668 ns/iter 3.108625646780381 ns/iter 0.95
Pointer_Object_Traverse 30.635674455270912 ns/iter 29.498679480754337 ns/iter 1.04
Pointer_Object_Try_Traverse 33.43939024961899 ns/iter 30.250554748787277 ns/iter 1.11
Pointer_Push_Back_Pointer_To_Weak_Pointer 157.82269350369026 ns/iter 174.27387654438024 ns/iter 0.91
Pointer_Walker_Schema_ISO_Language 1533692.4177778303 ns/iter 1620405.3435293483 ns/iter 0.95
Pointer_Maybe_Tracked_Deeply_Nested/0 1268266.7971275428 ns/iter 1219186.4130053753 ns/iter 1.04
Pointer_Maybe_Tracked_Deeply_Nested/1 1618649.6921295973 ns/iter 1655849.0562060934 ns/iter 0.98
Pointer_Position_Tracker_Get_Deeply_Nested 702.3415174782795 ns/iter 634.7307164788411 ns/iter 1.11
JSONPath_Descendant_Filter_Nested 1539.643054915003 ns/iter 1538.733957163287 ns/iter 1.00
URITemplateRouter_Create 21251.448651627714 ns/iter 23127.394199889757 ns/iter 0.92
URITemplateRouter_Match 178.0966356197276 ns/iter 174.86813650526045 ns/iter 1.02
URITemplateRouter_Match_BasePath 197.7432080638575 ns/iter 205.2990117726736 ns/iter 0.96
URITemplateRouterView_Restore 9684.491198951095 ns/iter 8499.753263613933 ns/iter 1.14
URITemplateRouterView_Match 142.53198886907148 ns/iter 147.06510255813797 ns/iter 0.97
URITemplateRouterView_Match_BasePath 163.4047573021025 ns/iter 163.94712319486 ns/iter 1.00
URITemplateRouterView_Arguments 454.3961755974827 ns/iter 441.56896754666445 ns/iter 1.03
JSONL_Parse_Large 9128394.753245972 ns/iter 9381133.472972296 ns/iter 0.97
JSONL_Parse_Large_GZIP 10994432.707693355 ns/iter 10876846.169230703 ns/iter 1.01
JSONLD_Catalog_Annotation_List_Populate 615603.7720523681 ns/iter 599894.2444061859 ns/iter 1.03
JSONLD_Catalog_Materialize 3496916.230000125 ns/iter 3640045.578680111 ns/iter 0.96
HTML_Build_Table_100000 63098924.99999706 ns/iter 57997384.18181732 ns/iter 1.09
HTML_Render_Table_100000 1937122.224376883 ns/iter 1917230.4699452836 ns/iter 1.01
GZIP_Compress_ISO_Language_Set_3_Locations 35679003.250004366 ns/iter 32445417.545452736 ns/iter 1.10
GZIP_Decompress_ISO_Language_Set_3_Locations 4292139.055214676 ns/iter 4280299.220858783 ns/iter 1.00
GZIP_Compress_ISO_Language_Set_3_Schema 2118872.2084593177 ns/iter 1858759.8455285493 ns/iter 1.14
GZIP_Decompress_ISO_Language_Set_3_Schema 276860.4369316033 ns/iter 360898.020544466 ns/iter 0.77
JOSE_VerifySignature_RS256 63735.789550605776 ns/iter 60270.45016411132 ns/iter 1.06
JOSE_VerifySignature_ES512 2653113.4886362157 ns/iter 2430034.219511937 ns/iter 1.09

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

Fixes: #2757
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti marked this pull request as ready for review August 19, 2026 16:14
@augmentcode

augmentcode Bot commented Aug 19, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR replaces PCRE2-based ECMA-262 validation with a dedicated grammar reader.

Changes:

  • Adds an internal recursive-descent parser for Unicode (`u`) and Unicode-sets (`v`) regex readings.
  • Implements ECMA syntax and early-error checks for groups, references, escapes, quantifiers, and classes.
  • Adds ECMA property-name, category, script, and binary-property lookup tables.
  • Updates is_regex_ecma to validate parsed grammar rather than compiling a translated PCRE2 pattern.
  • Extends permissive property translation for explicit general-category forms and aliases.
  • Removes the prior PCRE2 lookbehind rewrite and compiler-limit dependency from validation.
  • Expands tests for properties, set notation, modifiers, capture names, Unicode escapes, and large quantifiers.
Technical notes: Validation now accepts grammar-valid patterns that the matching engine may be unable to compile, including patterns beyond engine quantifier limits.

🤖 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. No suggestions at this time.

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

@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 9 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread src/core/regex/ecma262.h 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 (windows/msvc)

Details
Benchmark suite Current: 1e0c14d Previous: 18745f9 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 4.97208799999953 ns/iter 4.054339843750603 ns/iter 1.23
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.103307188638166 ns/iter 3.8428191964293545 ns/iter 1.33
Regex_Period_Asterisk 5.585585999999694 ns/iter 3.8462008859889876 ns/iter 1.45
Regex_Group_Period_Asterisk_Group 5.148079000000507 ns/iter 3.9779426714683037 ns/iter 1.29
Regex_Period_Plus 4.643657822865382 ns/iter 3.571132472098524 ns/iter 1.30
Regex_Period 4.637104028208532 ns/iter 3.6101369809656116 ns/iter 1.28
Regex_Caret_Period_Plus_Dollar 4.6245388496081965 ns/iter 3.5743391238794193 ns/iter 1.29
Regex_Caret_Group_Period_Plus_Group_Dollar 4.657303805039723 ns/iter 3.6082921810569095 ns/iter 1.29
Regex_Caret_Period_Asterisk_Dollar 4.976497999998628 ns/iter 3.9396149553575355 ns/iter 1.26
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.002461000001404 ns/iter 3.87963963592969 ns/iter 1.29
Regex_Caret_X_Hyphen 7.962141741071349 ns/iter 6.08830624999866 ns/iter 1.31
Regex_Period_Md_Dollar 56.76444642856738 ns/iter 49.03813999999329 ns/iter 1.16
Regex_Caret_Slash_Period_Asterisk 7.631842633928037 ns/iter 5.809700892858213 ns/iter 1.31
Regex_Caret_Period_Range_Dollar 5.361858928572311 ns/iter 4.227388757548008 ns/iter 1.27
Regex_Nested_Backtrack 76.96125000001989 ns/iter 67.92379464284538 ns/iter 1.13
JSON_Array_Of_Objects_Unique 675.8264508928135 ns/iter 491.0991924083511 ns/iter 1.38
JSON_Parse_1 9633.293154940857 ns/iter 8196.596890191639 ns/iter 1.18
JSON_Parse_Real 16660.213126429746 ns/iter 13172.732142858682 ns/iter 1.26
JSON_Parse_Decimal 11396.72968750105 ns/iter 8731.647321429393 ns/iter 1.31
JSON_Parse_Schema_ISO_Language 8469210.66666558 ns/iter 6987446.666668499 ns/iter 1.21
JSON_Parse_Integer 5970.7687500016555 ns/iter 4987.66160714175 ns/iter 1.20
JSON_Parse_String_NonSSO_Plain 8092.520122678549 ns/iter 6484.885714286293 ns/iter 1.25
JSON_Parse_String_SSO_Plain 3733.3444047426324 ns/iter 3224.9901785712204 ns/iter 1.16
JSON_Parse_String_Escape_Heavy 21585.578124998505 ns/iter 17673.486876027197 ns/iter 1.22
JSON_Parse_Object_Short_Keys 13002.50311382156 ns/iter 12292.344642856637 ns/iter 1.06
JSON_Parse_Object_Scalar_Properties 6639.090178570736 ns/iter 6204.586607144132 ns/iter 1.07
JSON_Parse_Object_Array_Properties 11515.146428572669 ns/iter 10186.48593750271 ns/iter 1.13
JSON_Parse_Object_Object_Properties 11682.78437500092 ns/iter 9710.582812498813 ns/iter 1.20
JSON_Parse_Nested_Containers 84245.29017858618 ns/iter 69957.46651785595 ns/iter 1.20
JSON_From_String_Copy 67.5478839285607 ns/iter 53.191330357143286 ns/iter 1.27
JSON_From_String_Temporary 83.8616480419072 ns/iter 64.28416964287261 ns/iter 1.30
JSON_Number_To_Double 129.91739285715605 ns/iter 103.78476562500794 ns/iter 1.25
JSON_Object_At_Last_Key/8 7.336948214285956 ns/iter 6.044524999999063 ns/iter 1.21
JSON_Object_At_Last_Key/32 24.432555530884375 ns/iter 19.339899279819356 ns/iter 1.26
JSON_Object_At_Last_Key/128 92.72035300357297 ns/iter 88.8792187499884 ns/iter 1.04
JSON_Object_At_Last_Key/512 432.4460497124751 ns/iter 333.6291056019566 ns/iter 1.30
JSON_Fast_Hash_Helm_Chart_Lock 118.48612499999689 ns/iter 93.38939315223935 ns/iter 1.27
JSON_Equality_Helm_Chart_Lock 206.3694062500332 ns/iter 160.1442857142794 ns/iter 1.29
JSON_Divisible_By_Decimal 411.19319196423834 ns/iter 302.75084821432023 ns/iter 1.36
JSON_String_Equal/10 10.055456249997263 ns/iter 7.698217633928449 ns/iter 1.31
JSON_String_Equal/100 11.444559375000551 ns/iter 8.789795050045079 ns/iter 1.30
JSON_String_Equal_Small_By_Perfect_Hash/10 2.1638109375004433 ns/iter 1.667361340402473 ns/iter 1.30
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 16.536310267858717 ns/iter 10.629482812500868 ns/iter 1.56
JSON_String_Fast_Hash/10 6.54754375000063 ns/iter 5.104381999999532 ns/iter 1.28
JSON_String_Fast_Hash/100 6.500624107143186 ns/iter 5.185983000001215 ns/iter 1.25
JSON_String_Key_Hash/10 4.961852999999792 ns/iter 3.8780597098205964 ns/iter 1.28
JSON_String_Key_Hash/100 10.952581249998872 ns/iter 8.605625000000268 ns/iter 1.27
JSON_Object_Defines_Miss_Same_Length 4.614736617443389 ns/iter 3.63459963717767 ns/iter 1.27
JSON_Object_Defines_Miss_Too_Small 4.613945769227279 ns/iter 3.61452142211684 ns/iter 1.28
JSON_Object_Defines_Miss_Too_Large 4.613801126370788 ns/iter 3.574455150664776 ns/iter 1.29
Pointer_Object_Traverse 65.22626785713977 ns/iter 51.88467000000401 ns/iter 1.26
Pointer_Object_Try_Traverse 67.35342633929417 ns/iter 52.481729999999516 ns/iter 1.28
Pointer_Push_Back_Pointer_To_Weak_Pointer 157.03870281078412 ns/iter 129.89787499999954 ns/iter 1.21
Pointer_Walker_Schema_ISO_Language 12817157.142856266 ns/iter 9330293.333335552 ns/iter 1.37
Pointer_Maybe_Tracked_Deeply_Nested/0 2422294.7791160154 ns/iter 1889071.0144930473 ns/iter 1.28
Pointer_Maybe_Tracked_Deeply_Nested/1 3674745.9893046077 ns/iter 2838038.1526107793 ns/iter 1.29
Pointer_Position_Tracker_Get_Deeply_Nested 552.1542410714833 ns/iter 424.0351004463706 ns/iter 1.30
JSONPath_Descendant_Filter_Nested 2408.3321428569043 ns/iter 2020.3097502764876 ns/iter 1.19
URITemplateRouter_Create 39855.083705348756 ns/iter 30476.74625726032 ns/iter 1.31
URITemplateRouter_Match 242.1982898303386 ns/iter 169.81354262144967 ns/iter 1.43
URITemplateRouter_Match_BasePath 252.46355814563282 ns/iter 190.72038309998246 ns/iter 1.32
URITemplateRouterView_Restore 26515.15576973888 ns/iter 20129.469905985363 ns/iter 1.32
URITemplateRouterView_Match 173.71972145440517 ns/iter 132.95460714285161 ns/iter 1.31
URITemplateRouterView_Match_BasePath 201.46955127370697 ns/iter 151.22587396601708 ns/iter 1.33
URITemplateRouterView_Arguments 606.6387499998882 ns/iter 475.1858789435933 ns/iter 1.28
JSONL_Parse_Large 33141624.999996115 ns/iter 25629330.769229107 ns/iter 1.29
JSONL_Parse_Large_GZIP 33572314.2857205 ns/iter 26089061.53846664 ns/iter 1.29
JSONLD_Catalog_Annotation_List_Populate 3276778.9743583985 ns/iter 2625058.3333338993 ns/iter 1.25
JSONLD_Catalog_Materialize 10322079.687501429 ns/iter 6605002.678572955 ns/iter 1.56
HTML_Build_Table_100000 94502014.28571095 ns/iter 73892477.77776593 ns/iter 1.28
HTML_Render_Table_100000 8143826.666666125 ns/iter 6571368.888888981 ns/iter 1.24
GZIP_Compress_ISO_Language_Set_3_Locations 38920131.57894182 ns/iter 28426855.999996405 ns/iter 1.37
GZIP_Decompress_ISO_Language_Set_3_Locations 10843632.000002496 ns/iter 7151307.142858545 ns/iter 1.52
GZIP_Compress_ISO_Language_Set_3_Schema 2337995.9866223997 ns/iter 1717366.9642858158 ns/iter 1.36
GZIP_Decompress_ISO_Language_Set_3_Schema 600812.3214286342 ns/iter 420407.89632307127 ns/iter 1.43
JOSE_VerifySignature_RS256 23850.917857138094 ns/iter 18389.454370128195 ns/iter 1.30
JOSE_VerifySignature_ES512 1538585.714285493 ns/iter 1202460.4687500328 ns/iter 1.28

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

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.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/regex/regex_is_ecma_test.cc">

<violation number="1" location="test/regex/regex_is_ecma_test.cc:768">
P2: These new tests expect is_regex_ecma to accept duplicate named capture groups split across alternatives, but current ECMA-262 treats duplicate named capture groups as a SyntaxError unconditionally (V8 rejects '(?:(?<x>a)|(?<x>b))|(?<x>c)' with 'Duplicate capture group name'). Returning TRUE here makes is_regex_ecma accept patterns the ECMA-262 grammar rejects, contradicting the PR's conformance goal; the permissive disjoint-alternative semantics are only the TC39 duplicate-named-groups proposal (Stage 3, not in the grammar). These expectations (and the matching ecma262.h behaviour) should assert FALSE.</violation>
</file>

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

Re-trigger cubic

EXPECT_FALSE(sourcemeta::core::is_regex_ecma("(?:(?<x>a)|(?<x>b))(?<x>c)"));
}

TEST(group_name_repeated_beside_an_alternation) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: These new tests expect is_regex_ecma to accept duplicate named capture groups split across alternatives, but current ECMA-262 treats duplicate named capture groups as a SyntaxError unconditionally (V8 rejects '(?:(?a)|(?b))|(?c)' with 'Duplicate capture group name'). Returning TRUE here makes is_regex_ecma accept patterns the ECMA-262 grammar rejects, contradicting the PR's conformance goal; the permissive disjoint-alternative semantics are only the TC39 duplicate-named-groups proposal (Stage 3, not in the grammar). These expectations (and the matching ecma262.h behaviour) should assert FALSE.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/regex/regex_is_ecma_test.cc, line 768:

<comment>These new tests expect is_regex_ecma to accept duplicate named capture groups split across alternatives, but current ECMA-262 treats duplicate named capture groups as a SyntaxError unconditionally (V8 rejects '(?:(?<x>a)|(?<x>b))|(?<x>c)' with 'Duplicate capture group name'). Returning TRUE here makes is_regex_ecma accept patterns the ECMA-262 grammar rejects, contradicting the PR's conformance goal; the permissive disjoint-alternative semantics are only the TC39 duplicate-named-groups proposal (Stage 3, not in the grammar). These expectations (and the matching ecma262.h behaviour) should assert FALSE.</comment>

<file context>
@@ -761,6 +761,34 @@ TEST(group_name_repeated_across_nested_alternatives) {
+  EXPECT_FALSE(sourcemeta::core::is_regex_ecma("(?:(?<x>a)|(?<x>b))(?<x>c)"));
+}
+
+TEST(group_name_repeated_beside_an_alternation) {
+  EXPECT_TRUE(sourcemeta::core::is_regex_ecma("(?:(?<x>a)|(?<x>b))|(?<x>c)"));
+}
</file context>

@jviotti
jviotti merged commit 852235d into main Aug 19, 2026
9 of 13 checks passed
@jviotti
jviotti deleted the regex-fixes-ecma branch August 19, 2026 17:06
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.

is_regex_ecma rejects \p{gc=Lu} and quantifier counts at or above 65536

1 participant