Skip to content

Add spawn_and_capture and give spawn a shared input settings type - #2723

Merged
jviotti merged 4 commits into
mainfrom
spawn-captured
Aug 13, 2026
Merged

Add spawn_and_capture and give spawn a shared input settings type#2723
jviotti merged 4 commits into
mainfrom
spawn-captured

Conversation

@jviotti

@jviotti jviotti commented Aug 12, 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 12, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR expands the process API with configurable execution input and captured output.

Changes:

  • Introduces ProcessInput for working directory, replacement environment, and standard input.
  • Updates both spawn overloads to consume the shared settings object.
  • Adds ProcessOutput and spawn_and_capture overloads for stdout/stderr collection.
  • Implements POSIX nonblocking pipe transfer to interleave input writes and output reads.
  • Implements Windows pipe handling, UTF-8-to-wide conversion, command-line quoting, and reader threads.
  • Adds child-process helpers and coverage for arguments, input, environment, directories, large streams, and signal termination.
  • Links the Windows process target to the text utility for case-insensitive environment ordering.
Technical Notes: The implementation retains inherited stdio for ordinary spawn calls while capture mode supplies EOF on stdin and drains both output streams.

🤖 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. 2 suggestions posted.

Fix All in Augment

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

Comment thread src/lang/process/spawn.cc
block.push_back(L'\0');
}

block.push_back(L'\0');

@augmentcode augmentcode Bot Aug 12, 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.

On Windows, src/lang/process/spawn.cc:166 produces a one-wide-NUL block when environment is an engaged empty map. CreateProcessW requires an empty Unicode environment block to end with two wide NULs, so it can read past this allocation and fail or pass unintended environment data instead of launching with an empty environment.

Severity: medium

Fix This in Augment

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

Comment thread src/lang/process/spawn.cc
// another thread cannot leak them into its own child. The descriptors this call
// hands to its child are duplicated onto the standard ones, and duplication
// clears that flag on the copy
auto make_pipe(Descriptor &read_end, Descriptor &write_end) -> bool {

@augmentcode augmentcode Bot Aug 12, 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.

In src/lang/process/spawn.cc:273, pipe() can allocate descriptor 0, 1, or 2 when the caller has closed a standard stream. A later dup2(fd, fd) file action leaves FD_CLOEXEC set, so that child standard stream is closed during exec and capture/input calls fail in such hosts.

Severity: medium

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.

2 issues found across 11 files

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="src/lang/process/command_line.h">

<violation number="1" location="src/lang/process/command_line.h:24">
P2: When an argument contains an embedded NUL without spaces or quotes, this branch copies it into `command_line`; `CreateProcessW` then truncates the argument and potentially the remaining command line. Reject embedded NULs before assembling the command line.</violation>
</file>

<file name="src/lang/process/spawn.cc">

<violation number="1" location="src/lang/process/spawn.cc:275">
P1: Concurrent spawns can inherit each other’s pipe endpoints because `make_pipe` enables close-on-exec after `pipe()` returns. Create the pipe with an atomic close-on-exec operation, or serialize descriptor creation with spawning.</violation>
</file>

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

Re-trigger cubic

Comment thread src/lang/process/spawn.cc
Comment thread src/lang/process/spawn.cc
Comment thread src/lang/process/spawn.cc
// clears that flag on the copy
auto make_pipe(Descriptor &read_end, Descriptor &write_end) -> bool {
std::array<int, 2> descriptors{};
if (::pipe(descriptors.data()) != 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Concurrent spawns can inherit each other’s pipe endpoints because make_pipe enables close-on-exec after pipe() returns. Create the pipe with an atomic close-on-exec operation, or serialize descriptor creation with spawning.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/lang/process/spawn.cc, line 275:

<comment>Concurrent spawns can inherit each other’s pipe endpoints because `make_pipe` enables close-on-exec after `pipe()` returns. Create the pipe with an atomic close-on-exec operation, or serialize descriptor creation with spawning.</comment>

<file context>
@@ -1,112 +1,474 @@
+// clears that flag on the copy
+auto make_pipe(Descriptor &read_end, Descriptor &write_end) -> bool {
+  std::array<int, 2> descriptors{};
+  if (::pipe(descriptors.data()) != 0) {
+    return false;
+  }
</file context>

std::string_view::npos};

if (!needs_quoting) {
command_line.append(argument);

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: When an argument contains an embedded NUL without spaces or quotes, this branch copies it into command_line; CreateProcessW then truncates the argument and potentially the remaining command line. Reject embedded NULs before assembling the command line.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/lang/process/command_line.h, line 24:

<comment>When an argument contains an embedded NUL without spaces or quotes, this branch copies it into `command_line`; `CreateProcessW` then truncates the argument and potentially the remaining command line. Reject embedded NULs before assembling the command line.</comment>

<file context>
@@ -0,0 +1,58 @@
+                               std::string_view::npos};
+
+  if (!needs_quoting) {
+    command_line.append(argument);
+    return;
+  }
</file context>

Comment thread src/lang/process/spawn.cc Outdated
Comment thread src/lang/process/spawn.cc
Comment thread test/process/process_spawn_input_test.cc

@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: 4880185 Previous: f0936ad Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.4381692618326065 ns/iter 1.665283755245378 ns/iter 1.46
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.7311900204008714 ns/iter 1.7892940760024014 ns/iter 1.53
Regex_Period_Asterisk 2.410021449606272 ns/iter 1.7231240337381148 ns/iter 1.40
Regex_Group_Period_Asterisk_Group 2.555335406418142 ns/iter 1.663049628816643 ns/iter 1.54
Regex_Period_Plus 3.054044023817667 ns/iter 1.884075785661479 ns/iter 1.62
Regex_Period 3.1385245788316483 ns/iter 1.9418325236191696 ns/iter 1.62
Regex_Caret_Period_Plus_Dollar 3.7628548629083287 ns/iter 1.9440913701948788 ns/iter 1.94
Regex_Caret_Group_Period_Plus_Group_Dollar 3.1635746341591164 ns/iter 1.8941669692869234 ns/iter 1.67
Regex_Caret_Period_Asterisk_Dollar 3.257809274106062 ns/iter 1.6922792702455192 ns/iter 1.93
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.5376683281735835 ns/iter 1.5843720199268554 ns/iter 1.60
Regex_Caret_X_Hyphen 8.31126543065965 ns/iter 5.6613387547786935 ns/iter 1.47
Regex_Period_Md_Dollar 32.11313639180889 ns/iter 16.55419450988517 ns/iter 1.94
Regex_Caret_Slash_Period_Asterisk 8.154697698167277 ns/iter 4.376134993700074 ns/iter 1.86
Regex_Caret_Period_Range_Dollar 3.416907167668614 ns/iter 2.006962736215187 ns/iter 1.70
Regex_Nested_Backtrack 47.71913423272069 ns/iter 26.987144759487137 ns/iter 1.77
JSON_Array_Of_Objects_Unique 462.31839961185455 ns/iter 315.9032975059628 ns/iter 1.46
JSON_Parse_1 5467.092925583878 ns/iter 3565.2147884140654 ns/iter 1.53
JSON_Parse_Real 7690.4617991007435 ns/iter 5151.200401529391 ns/iter 1.49
JSON_Parse_Decimal 7953.619668798574 ns/iter 5407.016522536694 ns/iter 1.47
JSON_Parse_Schema_ISO_Language 3406574.7339451853 ns/iter 2147765.5950921215 ns/iter 1.59
JSON_Parse_Integer 5405.5916599998 ns/iter 3087.005158382769 ns/iter 1.75
JSON_Parse_String_NonSSO_Plain 5528.375478331671 ns/iter 3198.292401790839 ns/iter 1.73
JSON_Parse_String_SSO_Plain 2681.061491266703 ns/iter 1837.9922127051395 ns/iter 1.46
JSON_Parse_String_Escape_Heavy 27642.20306701689 ns/iter 18003.135313451327 ns/iter 1.54
JSON_Parse_Object_Short_Keys 7260.113914465167 ns/iter 5434.234201700017 ns/iter 1.34
JSON_Parse_Object_Scalar_Properties 3708.326731522751 ns/iter 3060.30704675648 ns/iter 1.21
JSON_Parse_Object_Array_Properties 6458.845419999761 ns/iter 3962.7526329099155 ns/iter 1.63
JSON_Parse_Object_Object_Properties 6609.926899068346 ns/iter 3781.047822653251 ns/iter 1.75
JSON_Parse_Nested_Containers 34813.918770339835 ns/iter 32675.990552734427 ns/iter 1.07
JSON_From_String_Copy 27.9727801110084 ns/iter 24.135355073337625 ns/iter 1.16
JSON_From_String_Temporary 30.6268757100471 ns/iter 20.240670298743296 ns/iter 1.51
JSON_Number_To_Double 46.59226878149391 ns/iter 39.27413201290303 ns/iter 1.19
JSON_Object_At_Last_Key/8 5.323749164859989 ns/iter 4.936165073378474 ns/iter 1.08
JSON_Object_At_Last_Key/32 16.385900996305395 ns/iter 13.55405297117084 ns/iter 1.21
JSON_Object_At_Last_Key/128 97.80801017503386 ns/iter 59.846112667533184 ns/iter 1.63
JSON_Object_At_Last_Key/512 313.6848969481207 ns/iter 210.92097979726663 ns/iter 1.49
JSON_Fast_Hash_Helm_Chart_Lock 88.94066089067968 ns/iter 69.20120436894796 ns/iter 1.29
JSON_Equality_Helm_Chart_Lock 204.97112134425836 ns/iter 165.63078297145384 ns/iter 1.24
JSON_Divisible_By_Decimal 252.09779047413215 ns/iter 205.16155081822555 ns/iter 1.23
JSON_String_Equal/10 8.926981668926368 ns/iter 7.5039915958096275 ns/iter 1.19
JSON_String_Equal/100 8.823095999038667 ns/iter 7.119115902267926 ns/iter 1.24
JSON_String_Equal_Small_By_Perfect_Hash/10 0.47650977344205364 ns/iter 0.35279540772430606 ns/iter 1.35
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 4.229212716325555 ns/iter 3.7646229438895693 ns/iter 1.12
JSON_String_Fast_Hash/10 2.9540085631997957 ns/iter 2.330929874705364 ns/iter 1.27
JSON_String_Fast_Hash/100 2.2500678586360077 ns/iter 1.9040023959438306 ns/iter 1.18
JSON_String_Key_Hash/10 2.3380224478407605 ns/iter 1.783766954731418 ns/iter 1.31
JSON_String_Key_Hash/100 3.1886466375910163 ns/iter 2.3425414882279663 ns/iter 1.36
JSON_Object_Defines_Miss_Same_Length 3.6746993210934336 ns/iter 2.6441247136916313 ns/iter 1.39
JSON_Object_Defines_Miss_Too_Small 3.84365515939583 ns/iter 2.518789955309132 ns/iter 1.53
JSON_Object_Defines_Miss_Too_Large 3.775882473347334 ns/iter 2.5288621375070037 ns/iter 1.49
Pointer_Object_Traverse 26.88780707590417 ns/iter 19.36330049299929 ns/iter 1.39
Pointer_Object_Try_Traverse 39.44225239917407 ns/iter 26.15869063360453 ns/iter 1.51
Pointer_Push_Back_Pointer_To_Weak_Pointer 217.73164956038312 ns/iter 146.5997161274058 ns/iter 1.49
Pointer_Walker_Schema_ISO_Language 4166475.6315786527 ns/iter 2382185.087719591 ns/iter 1.75
Pointer_Maybe_Tracked_Deeply_Nested/0 1289023.2263514064 ns/iter 874337.8056497948 ns/iter 1.47
Pointer_Maybe_Tracked_Deeply_Nested/1 1459553.3676767466 ns/iter 1013668.5586853893 ns/iter 1.44
Pointer_Position_Tracker_Get_Deeply_Nested 451.8185196801768 ns/iter 372.83106711705216 ns/iter 1.21
JSONPath_Descendant_Filter_Nested 1715.2216667127395 ns/iter 1459.861928310006 ns/iter 1.17
URITemplateRouter_Create 34119.565217391435 ns/iter 25218.91735240351 ns/iter 1.35
URITemplateRouter_Match 233.08286713377905 ns/iter 205.15032521765258 ns/iter 1.14
URITemplateRouter_Match_BasePath 283.9765857333323 ns/iter 241.78749985318748 ns/iter 1.17
URITemplateRouterView_Restore 15657.53044090023 ns/iter 12449.991310658748 ns/iter 1.26
URITemplateRouterView_Match 186.96266695574295 ns/iter 164.80683863871892 ns/iter 1.13
URITemplateRouterView_Match_BasePath 197.73174851669393 ns/iter 174.9517963300339 ns/iter 1.13
URITemplateRouterView_Arguments 669.9601565585643 ns/iter 631.9879642028847 ns/iter 1.06
JSONL_Parse_Large 11661223.707691394 ns/iter 10869378.571427595 ns/iter 1.07
JSONL_Parse_Large_GZIP 13194482.019606963 ns/iter 11019936.264704831 ns/iter 1.20
JSONLD_Catalog_Annotation_List_Populate 1304629.783664453 ns/iter 1004317.8991303568 ns/iter 1.30
JSONLD_Catalog_Materialize 4569075.00000034 ns/iter 2965238.146551765 ns/iter 1.54
HTML_Build_Table_100000 55347054.461540565 ns/iter 37046462.944444 ns/iter 1.49
HTML_Render_Table_100000 2553676.094890781 ns/iter 1555798.2850465064 ns/iter 1.64
GZIP_Compress_ISO_Language_Set_3_Locations 36327758.350000754 ns/iter 25135312.499998007 ns/iter 1.45
GZIP_Decompress_ISO_Language_Set_3_Locations 4123975.9615380606 ns/iter 3110261.3146551787 ns/iter 1.33
GZIP_Compress_ISO_Language_Set_3_Schema 2109134.2324322453 ns/iter 1575929.1085972446 ns/iter 1.34
GZIP_Decompress_ISO_Language_Set_3_Schema 365046.0805879786 ns/iter 265486.5017585099 ns/iter 1.38
JOSE_VerifySignature_RS256 30157.562097039194 ns/iter 20330.08882273049 ns/iter 1.48
JOSE_VerifySignature_ES512 1293494.079136598 ns/iter 978261.5979381765 ns/iter 1.32

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

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

@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: 4880185 Previous: f0936ad Ratio
JOSE_VerifySignature_RS256 21080.977667417803 ns/iter 22465.06171143804 ns/iter 0.94
JOSE_VerifySignature_ES512 539906.0608160296 ns/iter 576752.2406947721 ns/iter 0.94
GZIP_Compress_ISO_Language_Set_3_Locations 30963500.826087315 ns/iter 36616250.63157795 ns/iter 0.85
GZIP_Decompress_ISO_Language_Set_3_Locations 3784863.112299144 ns/iter 4528249.812902951 ns/iter 0.84
GZIP_Compress_ISO_Language_Set_3_Schema 1991477.0767047426 ns/iter 2025864.9625360628 ns/iter 0.98
GZIP_Decompress_ISO_Language_Set_3_Schema 346604.26117180503 ns/iter 379961.65418022196 ns/iter 0.91
HTML_Build_Table_100000 62663039.636359744 ns/iter 59652769.916671865 ns/iter 1.05
HTML_Render_Table_100000 2513488.4793103617 ns/iter 2031942.2420747317 ns/iter 1.24
JSONLD_Catalog_Annotation_List_Populate 1339648.5908222802 ns/iter 1406569.1362724963 ns/iter 0.95
JSONLD_Catalog_Materialize 4156204.600000071 ns/iter 4688395.3157899175 ns/iter 0.89
JSONL_Parse_Large 10012914.071429739 ns/iter 10392289.01492552 ns/iter 0.96
JSONL_Parse_Large_GZIP 11288498.870968515 ns/iter 11792552.233331813 ns/iter 0.96
URITemplateRouter_Create 27043.37464940214 ns/iter 29772.094701818984 ns/iter 0.91
URITemplateRouter_Match 145.52844541505846 ns/iter 163.27624166205973 ns/iter 0.89
URITemplateRouter_Match_BasePath 165.15498181106165 ns/iter 185.81125227678643 ns/iter 0.89
URITemplateRouterView_Restore 3570.1232974509676 ns/iter 8716.976414224942 ns/iter 0.41
URITemplateRouterView_Match 115.26833886547134 ns/iter 125.0097196327185 ns/iter 0.92
URITemplateRouterView_Match_BasePath 130.18492686887927 ns/iter 143.6175578530077 ns/iter 0.91
URITemplateRouterView_Arguments 537.7460684690592 ns/iter 483.98900842631053 ns/iter 1.11
JSONPath_Descendant_Filter_Nested 1610.0754778014175 ns/iter 1706.0406597408526 ns/iter 0.94
Pointer_Object_Traverse 24.65398937540996 ns/iter 23.313630973803114 ns/iter 1.06
Pointer_Object_Try_Traverse 32.00041298348121 ns/iter 26.531464522284484 ns/iter 1.21
Pointer_Push_Back_Pointer_To_Weak_Pointer 151.9527538021978 ns/iter 158.56982139783537 ns/iter 0.96
Pointer_Walker_Schema_ISO_Language 2576721.529824585 ns/iter 2569163.3643122916 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/0 1157024.8085809597 ns/iter 1193931.5914529117 ns/iter 0.97
Pointer_Maybe_Tracked_Deeply_Nested/1 2060671.7852939817 ns/iter 1841869.9788918637 ns/iter 1.12
Pointer_Position_Tracker_Get_Deeply_Nested 494.87186514482164 ns/iter 505.1999982174073 ns/iter 0.98
JSON_Array_Of_Objects_Unique 409.89918749364233 ns/iter 483.1460101254013 ns/iter 0.85
JSON_Parse_1 4987.204579880277 ns/iter 5529.150863585725 ns/iter 0.90
JSON_Parse_Real 4986.114909842026 ns/iter 5732.385356784861 ns/iter 0.87
JSON_Parse_Decimal 8021.62425683684 ns/iter 10617.877202284692 ns/iter 0.76
JSON_Parse_Schema_ISO_Language 3499730.6400003936 ns/iter 3820388.135869611 ns/iter 0.92
JSON_Parse_Integer 3684.803232269834 ns/iter 3835.9575651315117 ns/iter 0.96
JSON_Parse_String_NonSSO_Plain 5108.449724417438 ns/iter 5353.836000240854 ns/iter 0.95
JSON_Parse_String_SSO_Plain 2755.468230421343 ns/iter 3125.6279774654913 ns/iter 0.88
JSON_Parse_String_Escape_Heavy 18592.102529609692 ns/iter 19729.386573554657 ns/iter 0.94
JSON_Parse_Object_Short_Keys 7681.096882488158 ns/iter 8588.11784565648 ns/iter 0.89
JSON_Parse_Object_Scalar_Properties 3976.143107201168 ns/iter 4412.159141600439 ns/iter 0.90
JSON_Parse_Object_Array_Properties 5822.1624524449235 ns/iter 6847.439520946389 ns/iter 0.85
JSON_Parse_Object_Object_Properties 5830.402424495115 ns/iter 6916.804438047535 ns/iter 0.84
JSON_Parse_Nested_Containers 45322.4766240462 ns/iter 48995.2643581071 ns/iter 0.93
JSON_From_String_Copy 15.026658350187583 ns/iter 17.787024952008892 ns/iter 0.84
JSON_From_String_Temporary 13.624221815056012 ns/iter 15.355936682546567 ns/iter 0.89
JSON_Number_To_Double 18.57174804269207 ns/iter 20.910063669933336 ns/iter 0.89
JSON_Object_At_Last_Key/8 4.978848991601714 ns/iter 3.7480901117251118 ns/iter 1.33
JSON_Object_At_Last_Key/32 18.501586667686663 ns/iter 11.896582673722916 ns/iter 1.56
JSON_Object_At_Last_Key/128 73.50829026437786 ns/iter 48.65493939871475 ns/iter 1.51
JSON_Object_At_Last_Key/512 300.2161634395925 ns/iter 361.026008144609 ns/iter 0.83
JSON_Fast_Hash_Helm_Chart_Lock 66.41673292187723 ns/iter 82.52633174134982 ns/iter 0.80
JSON_Equality_Helm_Chart_Lock 129.43890394925322 ns/iter 148.81494219456184 ns/iter 0.87
JSON_Divisible_By_Decimal 266.1916974363918 ns/iter 264.69365397302425 ns/iter 1.01
JSON_String_Equal/10 4.762349941245457 ns/iter 5.419041189310395 ns/iter 0.88
JSON_String_Equal/100 5.906978844949891 ns/iter 6.0393858652170165 ns/iter 0.98
JSON_String_Equal_Small_By_Perfect_Hash/10 0.8258134189162455 ns/iter 0.6241095205819758 ns/iter 1.32
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 16.994209491636184 ns/iter 25.21315613600876 ns/iter 0.67
JSON_String_Fast_Hash/10 3.2466162575868935 ns/iter 2.6091296996205005 ns/iter 1.24
JSON_String_Fast_Hash/100 3.224527236363047 ns/iter 2.6095260588192017 ns/iter 1.24
JSON_String_Key_Hash/10 1.1533101916262074 ns/iter 1.2484778185131478 ns/iter 0.92
JSON_String_Key_Hash/100 11.8345058302206 ns/iter 12.455538610151777 ns/iter 0.95
JSON_Object_Defines_Miss_Same_Length 3.3520618339541643 ns/iter 3.115965682684836 ns/iter 1.08
JSON_Object_Defines_Miss_Too_Small 2.8975861824511915 ns/iter 3.1149721909754615 ns/iter 0.93
JSON_Object_Defines_Miss_Too_Large 3.666006879593877 ns/iter 3.1720731109998175 ns/iter 1.16
Regex_Lower_S_Or_Upper_S_Asterisk 0.8648516085153267 ns/iter 0.6239425217071791 ns/iter 1.39
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.1520754208474653 ns/iter 0.9358268111171106 ns/iter 1.23
Regex_Period_Asterisk 0.8660237353108937 ns/iter 0.6232309093638849 ns/iter 1.39
Regex_Group_Period_Asterisk_Group 1.1521324246550602 ns/iter 0.935319441321698 ns/iter 1.23
Regex_Period_Plus 0.8643166827204155 ns/iter 0.6231501546124397 ns/iter 1.39
Regex_Period 1.1526122488594974 ns/iter 0.9355943551624858 ns/iter 1.23
Regex_Caret_Period_Plus_Dollar 0.8645805993018276 ns/iter 0.6237026785954851 ns/iter 1.39
Regex_Caret_Group_Period_Plus_Group_Dollar 1.152649139207462 ns/iter 0.9347567465325687 ns/iter 1.23
Regex_Caret_Period_Asterisk_Dollar 0.8646343056860195 ns/iter 0.6234869899664477 ns/iter 1.39
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.1523375388077053 ns/iter 0.9360091792529741 ns/iter 1.23
Regex_Caret_X_Hyphen 2.882069260451239 ns/iter 3.739062347217544 ns/iter 0.77
Regex_Period_Md_Dollar 22.715103526684096 ns/iter 28.220693816427183 ns/iter 0.80
Regex_Caret_Slash_Period_Asterisk 2.8880594642536646 ns/iter 4.050421798878851 ns/iter 0.71
Regex_Caret_Period_Range_Dollar 1.7320684798780348 ns/iter 1.5578730190148862 ns/iter 1.11
Regex_Nested_Backtrack 36.34380042660419 ns/iter 37.78938773920419 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: 7499f89 Previous: f0936ad Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.2269821848246485 ns/iter 2.0875618507515217 ns/iter 1.07
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.1872098706118637 ns/iter 2.064007674023423 ns/iter 1.06
Regex_Period_Asterisk 2.1863710098406473 ns/iter 2.042706427087091 ns/iter 1.07
Regex_Group_Period_Asterisk_Group 2.2186721007257058 ns/iter 2.0736254823510745 ns/iter 1.07
Regex_Period_Plus 3.113041628817947 ns/iter 2.3054370195527687 ns/iter 1.35
Regex_Period 2.801933373065472 ns/iter 2.034964626778813 ns/iter 1.38
Regex_Caret_Period_Plus_Dollar 2.5841501110579728 ns/iter 2.038298496003096 ns/iter 1.27
Regex_Caret_Group_Period_Plus_Group_Dollar 2.8035402106734497 ns/iter 2.3049334825497967 ns/iter 1.22
Regex_Caret_Period_Asterisk_Dollar 2.4907440008499577 ns/iter 2.009711743910717 ns/iter 1.24
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.194181943189864 ns/iter 2.055825222823591 ns/iter 1.07
Regex_Caret_X_Hyphen 5.846978598974463 ns/iter 3.7469863119092843 ns/iter 1.56
Regex_Period_Md_Dollar 28.65258166135101 ns/iter 24.547653403176685 ns/iter 1.17
Regex_Caret_Slash_Period_Asterisk 6.228774290831549 ns/iter 4.0339121081313145 ns/iter 1.54
Regex_Caret_Period_Range_Dollar 3.735303583049056 ns/iter 2.307957936109012 ns/iter 1.62
Regex_Nested_Backtrack 38.6353968691901 ns/iter 35.4376510358016 ns/iter 1.09
JSON_Array_Of_Objects_Unique 402.628300797733 ns/iter 362.21157488495544 ns/iter 1.11
JSON_Parse_1 4811.488585290735 ns/iter 4648.503996642799 ns/iter 1.04
JSON_Parse_Real 5166.090395397129 ns/iter 4648.832661758101 ns/iter 1.11
JSON_Parse_Decimal 7544.00896024491 ns/iter 7188.300221975575 ns/iter 1.05
JSON_Parse_Schema_ISO_Language 3546163.7424240774 ns/iter 3296421.9530513515 ns/iter 1.08
JSON_Parse_Integer 3736.4797082749615 ns/iter 3628.0927764535722 ns/iter 1.03
JSON_Parse_String_NonSSO_Plain 5055.772708904691 ns/iter 4704.698519036156 ns/iter 1.07
JSON_Parse_String_SSO_Plain 2702.232344848617 ns/iter 2341.7752254823868 ns/iter 1.15
JSON_Parse_String_Escape_Heavy 14090.67011155981 ns/iter 17737.152094235877 ns/iter 0.79
JSON_Parse_Object_Short_Keys 10468.862255786295 ns/iter 6989.781346312488 ns/iter 1.50
JSON_Parse_Object_Scalar_Properties 4035.013374900379 ns/iter 3660.5602827606863 ns/iter 1.10
JSON_Parse_Object_Array_Properties 5490.4307519071035 ns/iter 5019.2894576964645 ns/iter 1.09
JSON_Parse_Object_Object_Properties 5450.4160869264315 ns/iter 4934.364808258942 ns/iter 1.10
JSON_Parse_Nested_Containers 45336.92888055918 ns/iter 41739.75319021702 ns/iter 1.09
JSON_From_String_Copy 19.652602631550355 ns/iter 15.032123225601753 ns/iter 1.31
JSON_From_String_Temporary 17.473882719887403 ns/iter 14.90552034408887 ns/iter 1.17
JSON_Number_To_Double 24.03860247310871 ns/iter 20.54489653025833 ns/iter 1.17
JSON_Object_At_Last_Key/8 3.9270920785116172 ns/iter 4.706913628795102 ns/iter 0.83
JSON_Object_At_Last_Key/32 12.308775013680615 ns/iter 17.97213151486327 ns/iter 0.68
JSON_Object_At_Last_Key/128 49.06165089696083 ns/iter 73.88681256143431 ns/iter 0.66
JSON_Object_At_Last_Key/512 394.3069582518383 ns/iter 305.5633363806901 ns/iter 1.29
JSON_Fast_Hash_Helm_Chart_Lock 61.07393867226592 ns/iter 53.59821434520015 ns/iter 1.14
JSON_Equality_Helm_Chart_Lock 157.98414589928254 ns/iter 122.68146902137386 ns/iter 1.29
JSON_Divisible_By_Decimal 273.19351168923527 ns/iter 254.22764769636387 ns/iter 1.07
JSON_String_Equal/10 5.6128696616312865 ns/iter 4.035135537538972 ns/iter 1.39
JSON_String_Equal/100 6.237725684276005 ns/iter 5.188032565110988 ns/iter 1.20
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9353701553784013 ns/iter 0.8654613992887705 ns/iter 1.08
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 10.596226723974151 ns/iter 9.508239435183237 ns/iter 1.11
JSON_String_Fast_Hash/10 2.4913314053918207 ns/iter 2.0171407659005505 ns/iter 1.24
JSON_String_Fast_Hash/100 2.4912117527673767 ns/iter 2.018395703150429 ns/iter 1.23
JSON_String_Key_Hash/10 2.182331704348377 ns/iter 1.7316867163077525 ns/iter 1.26
JSON_String_Key_Hash/100 6.539530433825065 ns/iter 6.6390945526662195 ns/iter 0.99
JSON_Object_Defines_Miss_Same_Length 3.425674712449094 ns/iter 3.9506033950507815 ns/iter 0.87
JSON_Object_Defines_Miss_Too_Small 3.2297658419251234 ns/iter 3.456377827076031 ns/iter 0.93
JSON_Object_Defines_Miss_Too_Large 2.7684520315981245 ns/iter 3.475112497618315 ns/iter 0.80
Pointer_Object_Traverse 29.026569391155153 ns/iter 29.89617052532909 ns/iter 0.97
Pointer_Object_Try_Traverse 31.12589361258589 ns/iter 32.804864704673086 ns/iter 0.95
Pointer_Push_Back_Pointer_To_Weak_Pointer 159.30159065600714 ns/iter 176.82921793590444 ns/iter 0.90
Pointer_Walker_Schema_ISO_Language 2600258.7169811684 ns/iter 2711838.8543305094 ns/iter 0.96
Pointer_Maybe_Tracked_Deeply_Nested/0 1286793.1937268297 ns/iter 1132561.8834950377 ns/iter 1.14
Pointer_Maybe_Tracked_Deeply_Nested/1 1677070.6550925365 ns/iter 1982513.3626062504 ns/iter 0.85
Pointer_Position_Tracker_Get_Deeply_Nested 663.8693588299707 ns/iter 693.9835091074411 ns/iter 0.96
JSONPath_Descendant_Filter_Nested 1606.7755873355768 ns/iter 1505.772686610869 ns/iter 1.07
URITemplateRouter_Create 32702.488356833313 ns/iter 29562.61267338477 ns/iter 1.11
URITemplateRouter_Match 182.80824309461752 ns/iter 162.9661231614853 ns/iter 1.12
URITemplateRouter_Match_BasePath 205.84934199069252 ns/iter 181.10744597927942 ns/iter 1.14
URITemplateRouterView_Restore 8392.866532272128 ns/iter 3743.2462232875337 ns/iter 2.24
URITemplateRouterView_Match 140.02836869360536 ns/iter 126.80179967276099 ns/iter 1.10
URITemplateRouterView_Match_BasePath 163.271008768539 ns/iter 142.27906306138607 ns/iter 1.15
URITemplateRouterView_Arguments 435.0778062023022 ns/iter 423.77707411557844 ns/iter 1.03
JSONL_Parse_Large 9716579.541666368 ns/iter 8919255.653846648 ns/iter 1.09
JSONL_Parse_Large_GZIP 11432751.612904124 ns/iter 10321434.676471012 ns/iter 1.11
JSONLD_Catalog_Annotation_List_Populate 1311645.2481203151 ns/iter 1298820.1094620407 ns/iter 1.01
JSONLD_Catalog_Materialize 4383184.094936646 ns/iter 4396671.754717552 ns/iter 1.00
HTML_Build_Table_100000 64442308.45454513 ns/iter 71510272.80000335 ns/iter 0.90
HTML_Render_Table_100000 5245851.676691839 ns/iter 10004261.400000101 ns/iter 0.52
GZIP_Compress_ISO_Language_Set_3_Locations 33300821.047619354 ns/iter 30922517.56521838 ns/iter 1.08
GZIP_Decompress_ISO_Language_Set_3_Locations 4255375.396341395 ns/iter 5194056.5984253 ns/iter 0.82
GZIP_Compress_ISO_Language_Set_3_Schema 1881901.2768818217 ns/iter 1873477.21925123 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 355657.2127659606 ns/iter 351420.33533836977 ns/iter 1.01
JOSE_VerifySignature_RS256 57901.85479860746 ns/iter 49187.11672523232 ns/iter 1.18
JOSE_VerifySignature_ES512 2395745.50853229 ns/iter 2098449.0299401353 ns/iter 1.14

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

@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 (changes from recent commits).

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

Re-trigger cubic

Comment thread test/process/process_spawn_and_capture_main.cc Outdated
Comment thread src/lang/process/spawn.cc Outdated
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@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: 4880185 Previous: f0936ad Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 3.88168741764554 ns/iter 5.405940999999075 ns/iter 0.72
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.951833147321742 ns/iter 5.09814500000175 ns/iter 0.78
Regex_Period_Asterisk 3.89869308035719 ns/iter 5.047803571429199 ns/iter 0.77
Regex_Group_Period_Asterisk_Group 3.8821568080355764 ns/iter 5.1292080000007445 ns/iter 0.76
Regex_Period_Plus 3.5770067131607677 ns/iter 4.95372523427292 ns/iter 0.72
Regex_Period 3.6661023148818974 ns/iter 5.091698000001088 ns/iter 0.72
Regex_Caret_Period_Plus_Dollar 3.609727806859616 ns/iter 4.8517906260834565 ns/iter 0.74
Regex_Caret_Group_Period_Plus_Group_Dollar 3.6628328506022982 ns/iter 5.120448214285034 ns/iter 0.72
Regex_Caret_Period_Asterisk_Dollar 3.850233816964683 ns/iter 5.410884000000352 ns/iter 0.71
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.844896763392899 ns/iter 5.074965999999677 ns/iter 0.76
Regex_Caret_X_Hyphen 6.140985714285056 ns/iter 8.949439245760919 ns/iter 0.69
Regex_Period_Md_Dollar 47.25485225665331 ns/iter 44.34136857730532 ns/iter 1.07
Regex_Caret_Slash_Period_Asterisk 5.820314000000054 ns/iter 8.179159598216451 ns/iter 0.71
Regex_Caret_Period_Range_Dollar 4.183691250000265 ns/iter 6.054569999998876 ns/iter 0.69
Regex_Nested_Backtrack 58.897973214279936 ns/iter 55.25001000000884 ns/iter 1.07
JSON_Array_Of_Objects_Unique 518.5936999999967 ns/iter 581.6833928571035 ns/iter 0.89
JSON_Parse_1 7590.722098213781 ns/iter 8778.638488220151 ns/iter 0.86
JSON_Parse_Real 12960.75000000079 ns/iter 16072.033294863873 ns/iter 0.81
JSON_Parse_Decimal 8751.479234466418 ns/iter 11808.637499999719 ns/iter 0.74
JSON_Parse_Schema_ISO_Language 6224402.6785711935 ns/iter 7574807.777776489 ns/iter 0.82
JSON_Parse_Integer 4770.787317667469 ns/iter 6267.832142857596 ns/iter 0.76
JSON_Parse_String_NonSSO_Plain 5983.899107143032 ns/iter 7876.837053572164 ns/iter 0.76
JSON_Parse_String_SSO_Plain 2971.875278321145 ns/iter 3623.4193949172854 ns/iter 0.82
JSON_Parse_String_Escape_Heavy 16928.66517857082 ns/iter 21545.099999997317 ns/iter 0.79
JSON_Parse_Object_Short_Keys 14082.267187498943 ns/iter 13416.06131222594 ns/iter 1.05
JSON_Parse_Object_Scalar_Properties 6298.262276786458 ns/iter 6861.657366071328 ns/iter 0.92
JSON_Parse_Object_Array_Properties 9639.023932929671 ns/iter 11424.575000002538 ns/iter 0.84
JSON_Parse_Object_Object_Properties 9924.218195454201 ns/iter 11534.998437500833 ns/iter 0.86
JSON_Parse_Nested_Containers 68282.3928571403 ns/iter 79378.16964285511 ns/iter 0.86
JSON_From_String_Copy 49.281412393203674 ns/iter 65.85574107142682 ns/iter 0.75
JSON_From_String_Temporary 62.29282142856262 ns/iter 58.0064910714181 ns/iter 1.07
JSON_Number_To_Double 104.08275874629209 ns/iter 119.5049821428792 ns/iter 0.87
JSON_Object_At_Last_Key/8 6.017794642857106 ns/iter 7.380878348214484 ns/iter 0.82
JSON_Object_At_Last_Key/32 19.020999276972645 ns/iter 23.977041027044365 ns/iter 0.79
JSON_Object_At_Last_Key/128 77.05793749999705 ns/iter 94.68997767859224 ns/iter 0.81
JSON_Object_At_Last_Key/512 331.67255182385384 ns/iter 427.8367632779779 ns/iter 0.78
JSON_Fast_Hash_Helm_Chart_Lock 97.00862513353978 ns/iter 102.41773437499546 ns/iter 0.95
JSON_Equality_Helm_Chart_Lock 163.73287480353886 ns/iter 211.03559374999747 ns/iter 0.78
JSON_Divisible_By_Decimal 285.41634440107026 ns/iter 302.10115378336957 ns/iter 0.94
JSON_String_Equal/10 7.727022321428428 ns/iter 10.443136560519608 ns/iter 0.74
JSON_String_Equal/100 8.922944196427807 ns/iter 11.80847142856984 ns/iter 0.76
JSON_String_Equal_Small_By_Perfect_Hash/10 1.64810401785712 ns/iter 2.5439442857142627 ns/iter 0.65
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.63766428571489 ns/iter 14.199348150898322 ns/iter 1.03
JSON_String_Fast_Hash/10 4.940349999999398 ns/iter 6.645766071429193 ns/iter 0.74
JSON_String_Fast_Hash/100 5.048586000000341 ns/iter 6.738283928569899 ns/iter 0.75
JSON_String_Key_Hash/10 3.8641372767855837 ns/iter 5.393174107142938 ns/iter 0.72
JSON_String_Key_Hash/100 8.510181919643145 ns/iter 11.916257142859518 ns/iter 0.71
JSON_Object_Defines_Miss_Same_Length 3.0308604870118376 ns/iter 3.7704520089284643 ns/iter 0.80
JSON_Object_Defines_Miss_Too_Small 3.5038237554745706 ns/iter 4.114580676990592 ns/iter 0.85
JSON_Object_Defines_Miss_Too_Large 3.037151268253971 ns/iter 3.957098772321897 ns/iter 0.77
Pointer_Object_Traverse 51.25694000000749 ns/iter 71.44123214284751 ns/iter 0.72
Pointer_Object_Try_Traverse 54.68376000000035 ns/iter 71.39397321428272 ns/iter 0.77
Pointer_Push_Back_Pointer_To_Weak_Pointer 136.7208220213757 ns/iter 190.33193663681374 ns/iter 0.72
Pointer_Walker_Schema_ISO_Language 9859914.062499087 ns/iter 13730132.14285785 ns/iter 0.72
Pointer_Maybe_Tracked_Deeply_Nested/0 1927892.1874999355 ns/iter 2570511.440677303 ns/iter 0.75
Pointer_Maybe_Tracked_Deeply_Nested/1 2881548.5943778916 ns/iter 3877844.3850267474 ns/iter 0.74
Pointer_Position_Tracker_Get_Deeply_Nested 441.42159088733393 ns/iter 538.718630899721 ns/iter 0.82
JSONPath_Descendant_Filter_Nested 1898.9240168964623 ns/iter 2434.617142857373 ns/iter 0.78
URITemplateRouter_Create 30351.51193858827 ns/iter 41205.00813596755 ns/iter 0.74
URITemplateRouter_Match 169.5345403706274 ns/iter 234.51777516544317 ns/iter 0.72
URITemplateRouter_Match_BasePath 196.45930325528235 ns/iter 270.25106117195094 ns/iter 0.73
URITemplateRouterView_Restore 19779.326601131383 ns/iter 35232.33749999122 ns/iter 0.56
URITemplateRouterView_Match 134.67208928572308 ns/iter 186.63328035491716 ns/iter 0.72
URITemplateRouterView_Match_BasePath 151.8583258928682 ns/iter 207.0643970060375 ns/iter 0.73
URITemplateRouterView_Arguments 471.21834922721007 ns/iter 538.0092000000332 ns/iter 0.88
JSONL_Parse_Large 25649346.153845552 ns/iter 33042633.33333914 ns/iter 0.78
JSONL_Parse_Large_GZIP 25890419.230769075 ns/iter 33818014.285705954 ns/iter 0.77
JSONLD_Catalog_Annotation_List_Populate 2540211.4285713295 ns/iter 3268034.2723006317 ns/iter 0.78
JSONLD_Catalog_Materialize 6604381.111112111 ns/iter 11566907.812497362 ns/iter 0.57
HTML_Build_Table_100000 73673466.66665576 ns/iter 92367671.4285518 ns/iter 0.80
HTML_Render_Table_100000 6491207.777778779 ns/iter 8313831.111111844 ns/iter 0.78
GZIP_Compress_ISO_Language_Set_3_Locations 28574068.000002626 ns/iter 35942479.99999425 ns/iter 0.79
GZIP_Decompress_ISO_Language_Set_3_Locations 7128288.392857079 ns/iter 10484299.999999773 ns/iter 0.68
GZIP_Compress_ISO_Language_Set_3_Schema 1742999.7542997333 ns/iter 2123044.3749999492 ns/iter 0.82
GZIP_Decompress_ISO_Language_Set_3_Schema 401656.5873476467 ns/iter 638306.4285714113 ns/iter 0.63
JOSE_VerifySignature_RS256 18430.98190389673 ns/iter 21425.683361388623 ns/iter 0.86
JOSE_VerifySignature_ES512 1186241.964285679 ns/iter 1386133.1325301304 ns/iter 0.86

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

@jviotti
jviotti merged commit cb24956 into main Aug 13, 2026
12 of 13 checks passed
@jviotti
jviotti deleted the spawn-captured branch August 13, 2026 14:42
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