← Back to Pull requests

variants: allow mbedtls buffer lazy allocation #512

Closed
unknown closed this pull request without merging on Jun 16, 2026 15:42 UTC
View on GitHub
unknown unknown commented on Jun 12, 2026 15:29 UTC
Author

starting from this discussion This PR is an alternative implementation trying to reduce mbedtls RAM usage allocating the buffer only if the sketch includes TLS functionality.

Test results on GIGA R1

- 0.55.2 loader

 Memory region         Used Size  Region Size  %age Used
           FLASH:      534208 B       640 KB     81.51%
             RAM:      286616 B       512 KB     54.67%
            ITCM:          0 GB        64 KB      0.00%
            DTCM:       35600 B       128 KB     27.16%
          EXTMEM:          0 GB        16 MB      0.00%
           SRAM1:        256 KB       256 KB    100.00%
           SRAM3:          0 GB        32 KB      0.00%
           SRAM4:          0 GB        64 KB      0.00%
          SDRAM1:          4 MB         8 MB     50.00%
        IDT_LIST:          0 GB        32 KB      0.00%

- PR loader
 Memory region         Used Size  Region Size  %age Used
           FLASH:      534220 B       640 KB     81.52%
             RAM:      206616 B       512 KB     39.41%
            ITCM:          0 GB        64 KB      0.00%
            DTCM:       35600 B       128 KB     27.16%
          EXTMEM:          0 GB        16 MB      0.00%
           SRAM1:        256 KB       256 KB    100.00%
           SRAM3:          0 GB        32 KB      0.00%
           SRAM4:          0 GB        64 KB      0.00%
          SDRAM1:          4 MB         8 MB     50.00%
        IDT_LIST:          0 GB        32 KB      0.00%

WiFiWebClient.ino sketch

Sketch uses 39064 bytes (14%) of program storage space. Maximum is 262144 bytes.
Global variables use 8800 bytes (3%) of dynamic memory, leaving 253344 bytes for local variables. Maximum is 262144 bytes.

WiFiWebClientTLS.ino

ketch uses 42788 bytes (16%) of program storage space. Maximum is 262144 bytes.
Global variables use 89610 bytes (34%) of dynamic memory, leaving 172534 bytes for local variables. Maximum is 262144 bytes.

Diff: 260 lines (+195 / -65) across 3 files Reviewer: facchinm Review duration: 5772m
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.62) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 260 lines diff across 3 files
0.62
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.333
Shallow Review Depth shallow_review_depth
0.289
Sensitive Paths sensitive_paths
0.062
Real PR Conversation Timeline
1 comments
"Review active on #512"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed sensitive_module
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: 62.4% (MEDIUM) · Higher = larger blast radius
62.4%
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: 24.6% · Safe to merge
24.6%