Stop serialised compounds from raising the serializer recursion limit #653
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 182 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.312
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #653"
general
weight: 0.35
juntyr
Serializer recursion limit grows with every compound written
guard_recursion!takes one level ofrecursion_limitaround each nestedserializecall and gives it back afterwards, butCompound(returned byserialize_seq,serialize_map,serialize_struct, the tuple variants, etc.) also adds one back in itsDrop. When the limits were added in #420 that matched a decrement inCompound::try_new; #488 replacedtry_newwith the infallibleCompound::newand kept theDrop, so every sequence, map, struct or tuple serialised since then raises the remaining limit by one for the rest of the output.With the default limit of 128, a
Value::Seqholding 200,000 empty sequences followed by a 100,000-deep nested sequence aborts the process with a stack overflow inron::to_string, while the deep value on its own returnsExceededRecursionLimit. Withwith_recursion_limit(4), a depth-20 value is rejected alone but accepted after 50 empty siblings.Removed the unmatched
Drop. Depth accounting for a single nesting chain is unchanged, since every nested value already goes throughguard_recursion!, so the existing serializer limit tests behave the same. The new test intests/307_stack_overflow.rsfails on master and passes with the fix.cargo test --all-targetspasses with default features,integer128,indexmapand--all-features, andcargo fmt --checkis clean.CHANGELOG.md