Skip to content

Fix unsafe parallel polynomial scheduling estimates - #20

Merged
jwood000 merged 1 commit into
mainfrom
unsafe-scheduling
Dec 4, 2026
Merged

jwood000 merged 1 commit into
mainfrom
unsafe-scheduling

Conversation

@jwood000

@jwood000 jwood000 commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Parallel quadratic-sieve batches can reach or exceed the relation target before the scheduler recalculates remaining work, leading to invalid arithmetic and unsafe conversion to std::size_t.

This change stops scheduling when the target is reached, validates remaining-work estimates, and guards duration arithmetic against overflow. Invalid or empty batches use the existing serial fallback. Safe schedules retain the original integer-clock truncation, worker-selection rule, and 15/30-second batch decisions.

Adds public serial/parallel factorization coverage and development-only native regressions for completion, overflow, timing boundaries, and fallback behavior.

Validation:

  • All 500 package expectations passed.
  • All 50 native regression cases passed.
  • All 166,048 safe historical scheduling decisions matched exactly.
  • R CMD check --no-manual completed with Status: OK.

No sanitizers were run. Native diagnostics remain development-only, with no CI or dependency changes.

Fixes #19

Stop estimating work once the relation target is reached or exceeded.
Validate estimates and duration arithmetic, clearing both outputs for
serial fallback on invalid or empty batches. Preserve integer-clock
truncation and existing timing thresholds. Add native boundary
regressions and serial/parallel factorization checks.
@jwood000
jwood000 merged commit 9cda1b4 into main Dec 4, 2026
21 checks passed
@jwood000
jwood000 deleted the unsafe-scheduling branch December 4, 2026 05:29
@codecov

codecov Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.25%. Comparing base (7171778) to head (bb4d8a0).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/Polynomial.cpp 85.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
- Coverage   92.49%   92.25%   -0.24%     
==========================================
  Files          18       18              
  Lines        1572     1601      +29     
==========================================
+ Hits         1454     1477      +23     
- Misses        118      124       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Prevent invalid work estimates in parallel polynomial scheduling

1 participant