Skip to content

chore: reuse math rubric in hybrid math rubric#1043

Merged
mikasenghaas merged 3 commits intomainfrom
perf/hybrid-math-rubric-composition
Mar 20, 2026
Merged

chore: reuse math rubric in hybrid math rubric#1043
mikasenghaas merged 3 commits intomainfrom
perf/hybrid-math-rubric-composition

Conversation

@mikasenghaas
Copy link
Member

@mikasenghaas mikasenghaas commented Mar 19, 2026

Description

HybridMathRubric now holds an internal MathRubric instance and delegates math_verify calls to it instead of running parse()/verify() itself. This reuses MathRubric's ThreadPoolExecutor-based, non-blocking verification with hard timeout and executor auto-scaling.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes


Note

Medium Risk
Changes core math-scoring behavior by routing HybridMathRubric through MathRubric’s executor-based verification and new timeout/worker settings, which may alter pass/fail outcomes and performance under load.

Overview
Hybrid math grading now reuses MathRubric for local rule-based verification instead of calling math_verify directly. HybridMathRubric constructs an internal MathRubric (with configurable timeout_seconds/max_workers), clears its auto-registered reward funcs, and delegates math_verify_score to MathRubric.correct_answer.

Minor cleanup includes removing direct math_verify imports/logging in HybridMathRubric and tightening docstrings/behavior around when the LLM judge fallback runs.

Written by Cursor Bugbot for commit a8e2704. This will update automatically on new commits. Configure here.

mikasenghaas and others added 3 commits March 20, 2026 04:11
HybridMathRubric now holds an internal MathRubric instance and delegates
math_verify calls to it instead of running parse()/verify() synchronously
on the event loop. This reuses MathRubric's ThreadPoolExecutor-based,
non-blocking verification with hard timeout and executor auto-scaling,
preventing sympy from freezing the event loop on pathological expressions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mikasenghaas mikasenghaas changed the title chore: delegate HybridMathRubric math verification to MathRubric chore: reuse math rubric in hybrid math rubric Mar 20, 2026
@mikasenghaas mikasenghaas marked this pull request as ready for review March 20, 2026 11:45
@mikasenghaas mikasenghaas merged commit 4fd3c76 into main Mar 20, 2026
6 checks passed
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.

2 participants