Repository navigation
Conversation
NPOD's optimizer could move support points outside the box (e.g. k12 = 6.8 with bounds [0.001, 5]). Theta::suggest_point now clamps the point to the bounds before the distance check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTyUgJEd5uCEmv9qYrv8dC
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Candidate dimensionality must be validated before zip can silently truncate it.
1 open finding
What changed in this PR
Clamps NPOD support points to parameter bounds before distance checks.
Changes:
- Clamp proposed support points to valid ranges.
- Add unit and integration assertions for bounded results.
| File | Description |
|---|---|
src/estimation/nonparametric/theta.rs |
Implements clamping and unit coverage. |
tests/onecomp.rs |
Verifies bounded NPOD output and updated cycle count. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+118
to
+122
| let spp: Vec<f64> = spp | ||
| .iter() | ||
| .zip(self.parameters.finite_ranges()) | ||
| .map(|(val, (lower, upper))| val.clamp(lower, upper)) | ||
| .collect(); |
Contributor
|
| Project | PMcore |
| Branch | claude/pmetrics-pmcore-pharmsol-fixes-qdno6d-npod-bounds |
| Testbed | mhovd-pgx |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| bimodal_ke_npag | 📈 view plot 🚷 view threshold | 2,911.10 ms(-33.01%)Baseline: 4,345.58 ms | 6,448.85 ms (45.14%) |
| bimodal_ke_npod | 📈 view plot 🚷 view threshold | 907.86 ms(-30.73%)Baseline: 1,310.54 ms | 2,051.75 ms (44.25%) |
| bimodal_ke_postprob | 📈 view plot 🚷 view threshold | 382.24 ms(-1.96%)Baseline: 389.89 ms | 836.87 ms (45.68%) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Bug. NPOD's optimizer could move support points outside the parameter box. For example,
two_comp_ivwith bounds [0.001, 5] ended with k12 = 6.8 and k21 = 34.8.Fix.
Theta::suggest_pointnow clamps the point to the bounds before the distance check.Tests.
test_one_compartment_npod, the expected cycle count changes from 11 to 6: onmain, a final point had ke = 1.86 with bounds [0.1, 1].🤖 Generated with Claude Code
https://claude.ai/code/session_01GTyUgJEd5uCEmv9qYrv8dC
Generated by Claude Code