← Back to Pull requests

Reuse typed heap and numeric accessors #1440

Closed
unknown closed this pull request without merging on Nov 27, 2026 14:33 UTC
View on GitHub
unknown unknown commented on Nov 26, 2026 12:45 UTC
Author

Summary

Extract the caller refactorings from #1024 using the typed accessors introduced in #1421 and #1425.

  • Use typed allocation and reads at call sites that expect a single heap payload.

  • Use Value::as_long_int for arithmetic, comparison, and index conversion across interned and heap-backed integers.

  • Share the set storage projection for set, frozenset, and dictionary-view operations.
  • Validation

  • make format-rs and make lint-rs

  • 1,248 Rust tests passed with memory-model checks enabled

  • 1,628 Python fixture runs passed with CPython 3.14.10

  • An isolated release comparison of the numeric ordering rewrite ran 32 paired samples per workload. The paired median change was −0.84% for wide ordering and −0.34% for ordinary ordering. Both 95% bootstrap intervals included zero.
  • <!-- This is an auto-generated description by cubic. -->
    ---

    Summary by cubic


    Reworks single-payload call sites to use the typed heap accessors from #1421 and #1425 instead of manual Value::Ref/HeapData dispatch, and routes integer arithmetic, comparison, and index conversion through Value::as_long_int. This extraction from #1024 preserves behavior while shrinking the surface area left for the rest of that refactor.

    Refactors

  • set, frozenset, and dict-view operations share one SetStorage projection for equality and set operators.

  • Removes the now-unused LongInt::to_i64 and partial_cmp_f64 helpers; byte-object text extraction routes through Value::as_bytes.
  • Validation

  • Passes make format-rs, make lint-rs, 1,248 Rust tests with memory-model checks, and 1,628 Python fixture runs.

  • Adds fixture coverage for wide-integer boundary ordering and for dict keys/items views compared against a non-set operand.

  • The numeric ordering rewrite showed no significant regression: paired medians of −0.84% (wide ordering) and −0.34% (ordinary ordering), with both 95% bootstrap intervals including zero.
  • <sup>Written for commit a941a41fa4691610cc2189470ff12eb289fe216b. Summary will update on new commits.</sup>

    <a href="https://cubic.dev/pr/pydantic/monty/pull/1440?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>

    <!-- End of auto-generated description by cubic. -->

    Diff: 324 lines (+243 / -81) across 4 files Reviewer: rewitt94 Review duration: 1547m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 324 lines diff across 4 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.346
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1440"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.0% (MEDIUM) · Higher = larger blast radius
    47.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.6% · Safe to merge
    18.6%
    Repository