← Back to Pull requests

Use jax-transform based sow #5556

Open
samanklesaria opened this pull request with 941 lines diff across 6 files
View on GitHub
samanklesaria samanklesaria commented on Aug 17, 2026 21:28 UTC
Author

This PR swaps out the old sow implementation (which required the types/ shapes of variables we sowed to to change) with one written as a pure jax transform. Only variable mutation using ref is supported within the transform, as that's all that's needed if we already have sow. Closes #5538

Diff: 941 lines (+886 / -55) across 6 files Reviewer: cgarciae Review duration: 118318m
All Vouch review confidence checks passed
Residual risk 0.12 = Change Risk (0.57) × (1 − Review Confidence (0.79)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 941 lines diff across 6 files
0.57
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.70 · 2 substantive comment(s)
0.70
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
79%
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.400
Real PR Conversation Timeline
3 items
review-notebook-app[bot] review-notebook-app[bot] commented on Aug 17, 2026 21:28 UTC
Bot

Check out this pull request on&nbsp; <a href="https://app.reviewnb.com/google/flax/pull/5556"><img align="absmiddle" alt="ReviewNB" height="30" class="BotMessageButtonImage" src="https://raw.githubusercontent.com/ReviewNB/support/master/images/button_reviewnb.png" style="height: 30px !important;"/></a>

See visual diffs & provide feedback on Jupyter Notebooks.

---

<i>Powered by <a href='https://www.reviewnb.com/?utm_source=gh'>ReviewNB</a></i>

cgarciae cgarciae commented on code on Aug 21, 2026 21:00 UTC
Code Review
flax/nnx/module.py:1
@@ -149,6 +151,19 @@ def sow(
           variable_type, allow_register=True
       )
 
+    if config.nnx_functional_sow:

maybe its easier to make this a parameter for sow?

Reviewers
Assignees
samanklesaria samanklesaria
Labels
risk: low confidence: 79.4% 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: 57.3% (MEDIUM) · Higher = larger blast radius
57.3%
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: 79.4% · Lower = rushed or shallow review
79.4%
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: 11.8% · Safe to merge
11.8%
Repository