Skip to content

fix(causal): tolerate minor rho proxy overshoot#3

Merged
DaviBonetto merged 1 commit intomainfrom
codex/fix/colab-causal-repro-notebook
Mar 17, 2026
Merged

fix(causal): tolerate minor rho proxy overshoot#3
DaviBonetto merged 1 commit intomainfrom
codex/fix/colab-causal-repro-notebook

Conversation

@DaviBonetto
Copy link
Copy Markdown
Owner

@DaviBonetto DaviBonetto commented Mar 17, 2026

Keep the reproduction running when the rho proxy exceeds the target by a tiny numerical margin.

The clamp still fails on real regressions, but it no longer aborts the sweep for a 0.000199 overshoot in the proxy check.

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted threshold validation logic to use margin-based checking for improved flexibility in error detection.
    • Enhanced debug logging to provide clearer visibility into threshold overshoot events.

Keep the reproduction running when the rho proxy exceeds the target by a tiny numerical margin.

The clamp still fails on real regressions, but it no longer aborts the sweep for a 0.000199 overshoot in the proxy check.
@DaviBonetto DaviBonetto merged commit 650b878 into main Mar 17, 2026
1 of 2 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5afd85c3-e8a6-41ee-8326-69ea9bb0a920

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between de532db and fb6018d.

πŸ“’ Files selected for processing (1)
  • scripts/run_causal_intervention.py

πŸ“ Walkthrough

Walkthrough

The change refactors the rho-value threshold validation in the causal intervention script, transitioning from a strict per-channel check to a margin-based comparison using the maximum post-clamp rho value. Error reporting and debug logging are updated to reflect this new tolerance mechanism.

Changes

Cohort / File(s) Summary
Rho-value clamping logic
scripts/run_causal_intervention.py
Replaces strict per-channel threshold check with margin-based validation using max_rho_after and rho_margin = 1e-3. Raises RuntimeError with revised message if maximum post-clamp rho exceeds target plus margin; adds concise debug-mode overshoot logging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

A margin of grace for the rho so fine,
No longer strict, but with space to align,
The maximum whispers "overshoot, beware,"
With debug-mode notes, the rabbit declares! 🐰✨

✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix/colab-causal-repro-notebook
πŸ“ Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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