Skip to content

Perf/adaptfx core hotpath optimizations#9

Open
timsoleskos wants to merge 24 commits into
YoelPH:masterfrom
timsoleskos:perf/adaptfx-core-hotpath-optimizations
Open

Perf/adaptfx core hotpath optimizations#9
timsoleskos wants to merge 24 commits into
YoelPH:masterfrom
timsoleskos:perf/adaptfx-core-hotpath-optimizations

Conversation

@timsoleskos

Copy link
Copy Markdown
Collaborator

This PR makes the existing 3D adaptive fractionation core faster and cleaner (without carrying over my 5D extension).

In CI, the reported pytest runtime drops from 3.09s on master to 2.28s on this branch, which is about a 26% reduction. The full workflow remains mostly setup-bound, so the wall-clock CI improvement is smaller.

Main changes:

  • Optimizes hot paths in the core DP code by avoiding repeated SciPy interpolation/object construction and using lighter NumPy-based interpolation.
  • Updates get_state_space / probdist to work from (mean, std) tuples, and updates internal call sites accordingly.
  • Restores and clarifies policy_calc, keeping it as a notebook/visualization helper while routing it through the newer helper flow.
  • Improves precompute_plan by reusing the candidate-volume buffer and continuing the scan until both the relevant volume range and minimum-policy condition are reached.
  • Names previously implicit constants, including INFEASIBLE_VALUE, dose-grid tolerances, and the precompute scan assumptions.
  • Removes obsolete slow test markers now that the suite runs quickly.
  • Removes unused helper code and fixes small app, plotting, docstring, and test issues found during the cleanup.

@timsoleskos timsoleskos self-assigned this May 31, 2026
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