perf(mmle): use matrix-vector EAP projection - #574
Conversation
Optimized the calculation of `theta` in `python/fast_mlsirm/estimators/mmle.py` by replacing the element-wise multiplication and summation `(posterior * nodes[None, :]).sum(axis=1)` with a matrix multiplication (dot product) `posterior @ nodes`. This removes the intermediate allocation of a full N x Q array and leverages highly-optimized BLAS operations, resulting in a substantial speedup and lower memory footprint.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
📝 WalkthroughWalkthroughThe MMLE NumPy fallback now validates quadrature and workspace limits before allocation. It computes EAP with ChangesMMLE NumPy fallback
Changelog renderer formatting
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Optimized the calculation of `theta` in `python/fast_mlsirm/estimators/mmle.py` by replacing the element-wise multiplication and summation `(posterior * nodes[None, :]).sum(axis=1)` with a matrix multiplication (dot product) `posterior @ nodes`. This removes the intermediate allocation of a full N x Q array and leverages highly-optimized BLAS operations, resulting in a substantial speedup and lower memory footprint.
Optimized the calculation of `theta` in `python/fast_mlsirm/estimators/mmle.py` by replacing the element-wise multiplication and summation `(posterior * nodes[None, :]).sum(axis=1)` with a matrix multiplication (dot product) `posterior @ nodes`. This removes the intermediate allocation of a full N x Q array and leverages highly-optimized BLAS operations, resulting in a substantial speedup and lower memory footprint.
|
Exact-head bounded repair handoff for |
Acknowledged. I have checked out the exact SHA |
Rendered authoritative CHANGELOG.md from existing fragments using `scripts/render_changelog_fragments.py --update CHANGELOG.md` to resolve CI failure.
|
@coderabbitai review Review-only request for exact head |
|
|
|
Exact-current-head review request after bounded scope cleanup and exact-head validation. Head: CI, Security Scan, and SAST Semgrep are terminal-success on this exact unchanged head. The unrelated changelog-renderer formatting was removed from the PR; the remaining scope is the NumPy reference/fallback EAP matvec change, deterministic parity/source regression, authoritative changelog fragment/rendering, and doctoring. No predecessor-head review or check evidence is being transferred. @coderabbitai review Review read-only. Please inspect the exact current head and submit only evidence-backed findings/verdicts. Do not update the branch, synthesize approval, weaken tests, or merge. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected_head='c694df8eaba9f9b45f54d2a9c0b303783c61adb9'
expected_base='29570236d86aa6eb819da246a0c44c310764f3c7'
echo '== Revision validation =='
echo "HEAD: $(git rev-parse HEAD)"
echo "Expected HEAD: $expected_head"
git cat-file -e "${expected_head}^{commit}"
git cat-file -e "${expected_base}^{commit}"
git merge-base --is-ancestor "$expected_base" "$expected_head"
echo "Merge-base(expected base, expected head): $(git merge-base "$expected_base" "$expected_head")"
echo '== Changed files =='
git diff --name-status "$expected_base" "$expected_head"
echo '== Diff stat =='
git diff --stat "$expected_base" "$expected_head"
echo '== Full diff =='
git diff --find-renames --find-copies --no-ext-diff "$expected_base" "$expected_head"
echo '== Candidate source and test files =='
fd -HI -t f . | rg -i '(mmle|eap|theta|changelog|doctor|numpy|test)'
echo '== Python structure map =='
fd -HI -e py -t f . | xargs -r ast-grep outline --lang python --items all --type function,class 2>/dev/null || true
echo '== Projection expressions and test assertions =='
rg -n -C 5 --glob '*.py' \
'(posterior\s*@\s*nodes|posterior\s*\*\s*nodes|\.sum\(axis\s*=\s*1\)|matmul|EAP|eap|theta)' .
echo '== Changelog and doctoring references =='
rg -n -C 4 \
'(bolt-mmle-theta-optimization|matvec|matrix-vector|matrix vector|NumPy|numpy|Rust-primary|Rust primary|EAP)' \
CHANGELOG.md docs 2>/dev/null || true
echo '== Repository policy and test configuration files =='
fd -HI -t f '^(pyproject\.toml|pytest\.ini|tox\.ini|CONTRIBUTING\.md|AGENTS\.md|README\.md)$' . -x sh -c 'echo "--- $1"; sed -n "1,240p" "$1"' sh {} \;Length of output: 201618 🏁 Script executed: #!/bin/bash
set -euo pipefail
base='29570236d86aa6eb819da246a0c44c310764f3c7'
head='c694df8eaba9f9b45f54d2a9c0b303783c61adb9'
test "$(git rev-parse HEAD)" = "$head"
test "$(git merge-base "$base" "$head")" = "$base"
echo '== CodeGraph, if installed =='
if command -v codegraph >/dev/null 2>&1; then
if [ ! -d .codegraph ]; then
codegraph init . || true
fi
codegraph explore 'MMLE NumPy fallback EAP posterior nodes theta projection' || true
fi
echo '== Exact changed paths =='
git diff --name-only "$base" "$head"
echo '== Exact changed patch =='
git diff --no-ext-diff --unified=80 "$base" "$head" -- \
python/fast_mlsirm/estimators/mmle.py \
tests/test_mmle_eap_projection_contract.py \
docs/changelog.d/bolt-mmle-theta-optimization.md \
docs/doctoring/mmle-eap-matvec-projection.md \
CHANGELOG.md
echo '== EAP implementation context =='
if [ -f python/fast_mlsirm/estimators/mmle.py ]; then
ast-grep outline python/fast_mlsirm/estimators/mmle.py --lang python --items all --type function
rg -n -C 35 'posterior\s*@\s*nodes|theta\s*=|posterior\s*\*\s*nodes' \
python/fast_mlsirm/estimators/mmle.py
fi
echo '== Contract-test contents =='
if [ -f tests/test_mmle_eap_projection_contract.py ]; then
cat -n tests/test_mmle_eap_projection_contract.py
fi
echo '== Doctoring contents =='
if [ -f docs/doctoring/mmle-eap-matvec-projection.md ]; then
cat -n docs/doctoring/mmle-eap-matvec-projection.md
fi
echo '== Render-parity evidence =='
if [ -f scripts/render_changelog_fragments.py ]; then
rg -n -C 10 '(CHANGELOG|changelog\.d|Unreleased|render)' scripts/render_changelog_fragments.py
fi
python - <<'PY'
from pathlib import Path
fragment = Path("docs/changelog.d/bolt-mmle-theta-optimization.md")
changelog = Path("CHANGELOG.md")
if fragment.exists() and changelog.exists():
title = fragment.read_text(encoding="utf-8").splitlines()[0].removeprefix("# ").strip()
print(f"fragment_title={title!r}")
print(f"heading_occurrences={changelog.read_text(encoding='utf-8').count('#### ' + title)}")
PY
echo '== Changed-file names outside declared scope =='
git diff --name-only "$base" "$head" | grep -vE \
'^(python/fast_mlsirm/estimators/mmle\.py|tests/test_mmle_eap_projection_contract\.py|docs/changelog\.d/bolt-mmle-theta-optimization\.md|docs/doctoring/mmle-eap-matvec-projection\.md|CHANGELOG\.md)$' \
|| trueLength of output: 51048 🏁 Script executed: #!/bin/bash
set -euo pipefail
head='c694df8eaba9f9b45f54d2a9c0b303783c61adb9'
echo '== Public dispatch and Rust-primary boundary =='
rg -n -C 18 --glob '*.py' \
'(fit_mmle_2pl\s*\(|_core.*fit_mmle_2pl|fit_mmle_2pl.*_core|backend.*(auto|rust|numpy)|estimator\s*==\s*["'\'']mmle)' \
python/fast_mlsirm
echo '== Exact PR and check-run metadata from GitHub =='
gh pr view 574 --repo ContextualWisdomLab/fast-mlsirm \
--json number,state,isDraft,headRefOid,baseRefOid,statusCheckRollup \
--jq '{number, state, isDraft, headRefOid, baseRefOid, checks: [.statusCheckRollup[] | {name, status, conclusion, headSha: .detailsUrl}]}'
echo '== Commit status and check runs for the requested SHA =='
gh api "repos/ContextualWisdomLab/fast-mlsirm/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | [.name, .status, .conclusion, .html_url] | `@tsv`'
gh api "repos/ContextualWisdomLab/fast-mlsirm/commits/${head}/status" \
--jq '{sha, state, statuses: [.statuses[] | {context, state, target_url}]}'
echo '== Static changelog render-parity calculation =='
python - <<'PY'
from collections import defaultdict
from pathlib import Path
import re
root = Path(".")
fragment_dir = root / "docs" / "changelog.d"
changelog_path = root / "CHANGELOG.md"
allowed = ("Added", "Changed", "Deprecated", "Removed", "Fixed", "Security")
def parse_fragment(path):
lines = path.read_text(encoding="utf-8").splitlines()
if not lines or not lines[0].startswith("# "):
raise SystemExit(f"invalid title: {path}")
title = lines[0][2:].strip()
groups = defaultdict(list)
current = None
for line in lines[1:]:
if line.startswith("## "):
current = line[3:].strip()
if current not in allowed:
raise SystemExit(f"invalid section {current!r}: {path}")
elif line.strip():
if current is None:
raise SystemExit(f"content before section: {path}")
groups[current].append(line.rstrip())
return title, groups
groups = defaultdict(list)
for path in sorted(fragment_dir.glob("*.md")):
if path.name.casefold() == "readme.md":
continue
title, sections = parse_fragment(path)
for section, lines in sections.items():
groups[section].append((title, lines))
rendered = ["## Unreleased", ""]
for section in allowed:
for title, lines in groups.get(section, []):
rendered.extend([f"### {section}", "", f"#### {title}", "", *lines, ""])
# Collapse repeated section headings to the renderer's intended grouping.
rendered = ["## Unreleased", ""]
for section in allowed:
entries = groups.get(section, [])
if entries:
rendered.extend([f"### {section}", ""])
for title, lines in entries:
rendered.extend([f"#### {title}", "", *lines, ""])
expected_body = "\n".join(rendered).rstrip() + "\n"
actual = changelog_path.read_text(encoding="utf-8")
begin = "<!-- BEGIN AUTHORITATIVE CHANGELOG FRAGMENTS -->"
end = "<!-- END AUTHORITATIVE CHANGELOG FRAGMENTS -->"
start = actual.index(begin) + len(begin)
stop = actual.index(end, start)
actual_body = actual[start:stop].strip() + "\n"
expected_managed = expected_body.split("\n\n", 1)[1]
print(f"fragment_count={sum(1 for p in fragment_dir.glob('*.md') if p.name.casefold() != 'readme.md')}")
print(f"managed_block_matches_all_fragments={actual_body == expected_managed}")
if actual_body != expected_managed:
raise SystemExit("managed changelog block differs from deterministic fragment rendering")
PYLength of output: 48848
Review evidence:
The exact-head Python, Rust, package, coverage, and security checks are successful. The
|
|
@coderabbitai review Please review exact head |
|
Review-only exact-head request for |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/fast-mlsirm'
pr='574'
base='29570236d86aa6eb819da246a0c44c310764f3c7'
head='c694df8eaba9f9b45f54d2a9c0b303783c61adb9'
echo '== Revision and PR validation =='
printf 'checkout_head='; git rev-parse HEAD
printf 'requested_head=%s\n' "$head"
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"
printf 'merge_base='; git merge-base "$base" "$head"
gh pr view "$pr" --repo "$repo" \
--json number,state,isDraft,headRefOid,baseRefOid \
--jq '{number,state,isDraft,headRefOid,baseRefOid}'
echo '== Changed paths and complete requested diff =='
git diff --name-status "$base" "$head"
git diff --no-ext-diff --find-renames --find-copies --unified=60 "$base" "$head"
echo '== Affected implementation and dispatch context =='
ast-grep outline python/fast_mlsirm/estimators/mmle.py --lang python --items all --type function,class
rg -n -C 35 --glob '*.py' \
'(theta\s*=\s*posterior\s*@\s*nodes|theta\s*=\s*\(posterior\s*\*\s*nodes\[None,\s*:\]\)\.sum\(axis=1\)|def fit_mmle_2pl|_core\.fit_mmle_2pl|fit_mmle_2pl\s*\()' \
python/fast_mlsirm
echo '== Contract test and doctoring =='
cat -n tests/test_mmle_eap_projection_contract.py
cat -n docs/doctoring/mmle-eap-matvec-projection.md
cat -n docs/changelog.d/bolt-mmle-theta-optimization.md
echo '== Projection patterns outside tests =='
rg -n -C 4 --glob '*.py' -g '!tests/**' \
'posterior\s*\*\s*nodes|posterior\s*@\s*nodes|\.sum\(axis\s*=\s*1\)' \
python
echo '== Static authoritative-fragment render parity =='
python - <<'PY'
from collections import defaultdict
from pathlib import Path
allowed = ("Added", "Changed", "Deprecated", "Removed", "Fixed", "Security")
fragment_dir = Path("docs/changelog.d")
changelog = Path("CHANGELOG.md").read_text(encoding="utf-8")
entries = defaultdict(list)
for path in sorted(fragment_dir.glob("*.md")):
if path.name.casefold() == "readme.md":
continue
lines = path.read_text(encoding="utf-8").splitlines()
if not lines or not lines[0].startswith("# "):
raise SystemExit(f"invalid fragment title: {path}")
title = lines[0][2:].strip()
section = None
body = defaultdict(list)
for line in lines[1:]:
if line.startswith("## "):
section = line[3:].strip()
if section not in allowed:
raise SystemExit(f"invalid fragment section {section!r}: {path}")
elif line.strip():
if section is None:
raise SystemExit(f"content before section: {path}")
body[section].append(line.rstrip())
for section, values in body.items():
entries[section].append((title, values))
expected = []
for section in allowed:
if entries[section]:
expected.extend([f"### {section}", ""])
for title, values in entries[section]:
expected.extend([f"#### {title}", "", *values, ""])
expected = "\n".join(expected).rstrip() + "\n"
begin = "<!-- BEGIN AUTHORITATIVE CHANGELOG FRAGMENTS -->"
end = "<!-- END AUTHORITATIVE CHANGELOG FRAGMENTS -->"
start = changelog.index(begin) + len(begin)
stop = changelog.index(end, start)
actual = changelog[start:stop].strip() + "\n"
print(f"fragment_count={sum(p.name.casefold() != 'readme.md' for p in fragment_dir.glob('*.md'))}")
print(f"managed_block_matches_static_render={actual == expected}")
if actual != expected:
raise SystemExit("managed block does not match static fragment rendering")
PY
echo '== Exact-head check status =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | [.name,.status,.conclusion] | `@tsv`'
gh api "repos/${repo}/commits/${head}/status" \
--jq '{sha,state,statuses:[.statuses[]|{context,state}]}'Length of output: 68754 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/fast-mlsirm'
head='c694df8eaba9f9b45f54d2a9c0b303783c61adb9'
echo '== Strix check metadata =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | select(.name == "strix") | {id,name,status,conclusion,details_url,output}'
details_url=$(gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq -r '.check_runs[] | select(.name == "strix") | .details_url')
printf 'details_url=%s\n' "$details_url"
if [[ "$details_url" =~ /actions/runs/([0-9]+) ]]; then
run_id="${BASH_REMATCH[1]}"
echo '== Strix workflow run summary =='
gh run view "$run_id" --repo "$repo" --json databaseId,name,status,conclusion,event,headSha,url,jobs \
--jq '{databaseId,name,status,conclusion,event,headSha,url,jobs:[.jobs[]|{name,status,conclusion,steps:[.steps[]|select(.conclusion=="failure")|{name,number,conclusion}]}]}'
echo '== Strix failed-job log =='
gh run view "$run_id" --repo "$repo" --log-failed
fiLength of output: 1748 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/fast-mlsirm'
check_run_id='93061905938'
run_id='31241037696'
echo '== Strix annotation =='
gh api "repos/${repo}/check-runs/${check_run_id}/annotations?per_page=100" \
--jq '.[] | {path,start_line,end_line,annotation_level,message,title,raw_details}'
echo '== Strix workflow summary =='
gh run view "$run_id" --repo "$repo" \
--json databaseId,name,status,conclusion,event,headSha,url,jobs \
--jq '{databaseId,name,status,conclusion,event,headSha,url,jobs:[.jobs[]|{name,status,conclusion,steps:[.steps[]|select(.conclusion=="failure")|{name,number,conclusion}]}]}'
echo '== Strix failed-job log =='
gh run view "$run_id" --repo "$repo" --log-failedLength of output: 1361
Review evidence:
The Python, Rust, package, coverage, and security checks succeeded on this exact head. The I did not modify the branch, approve, or merge. You are interacting with an AI system. |
|
@cwl-noema-review review Independently review exact head |
I have completed the exact auditable ancestry refresh onto the current protected-main tip ( I resolved The integrated essay-validation empty-state changes (source, tests, fragment) remain byte-equivalent to protected main, dropping the previous unrelated path check. All #574 MMLE EAP optimizations, resource boundaries, and parity constraints were perfectly preserved. The resulting branch successfully passes all MMLE projection contracts, changelog checks, Pytest, and Cargo test suites, and remains in Draft. |
Merged exact protected main (4d910ed) into the PR branch, resolving CHANGELOG.md strictly via the authoritative `render_changelog_fragments.py` script. Dropped the unrelated/overlapping essay-validation path fix so that module remains byte-equivalent to main. Preserved all MMLE workspace limits, fallback caps, and EAP optimizations. All tests pass locally.
|
@opencode-agent address Exact-head ancestry repair handoff. Operate only if PR #574 is still at RCA target is ancestry/integration correctness, not the EAP formula. Use a trusted checkout and choose the smallest auditable reconciliation that preserves protected-main changes and the bounded unique #574 slice. Prefer a normal two-parent merge of exact protected main into the existing branch if conflicts can be resolved path-by-path without overwriting either side; otherwise build a controlled replacement from exact protected main containing only #574's genuine unique MMLE changes/tests/doctoring/changelog fragment, preserving fail-first lineage in the PR discussion. Never force-push, use After reconciliation, render the authoritative changelog, run the focused MMLE EAP/quadrature/resource tests plus |
I have completed the exact-head ancestry repair. I verified that the PR was diverged and then performed a clean two-parent merge of exact protected main ( |
Merged exact protected main to repair diverged ancestry, resolving the CHANGELOG.md conflict cleanly with `render_changelog_fragments.py`. This preserves the unique MMLE EAP matvec optimizations while ensuring no unintended files (like essay validation) are modified from main.
|
@opencode-agent address Reacquire a bounded ancestry-repair lease only if a final refetch still shows Draft head Perform exactly one normal, auditable reconciliation pass. Prefer a two-parent merge of exact protected main into the existing branch. Preserve every protected-main change and only the genuine #574 NumPy-reference/fallback MMLE EAP/quadrature/workspace slice. Do not treat main-origin report/essay-validation/accessibility files visible in the three-dot compare as #574-owned changes. Resolve After reconciliation run |
I have successfully performed the exact auditable ancestry-repair lease. I verified the requested exact Draft head ( |
Merged exact protected main `7516031df533` to repair diverged ancestry, resolving the `CHANGELOG.md` conflict cleanly with `render_changelog_fragments.py`. The essay-validation files remain byte-equivalent to main, while the unique MMLE EAP matvec optimizations and workspace caps are successfully preserved.
|
@opencode-agent address Operate only on exact current Draft head Repair integration, not product scope:
If a normal auditable merge cannot preserve this bounded slice without destructive history rewriting, do not force-push. Instead report that exact conflict set on the PR and stop writing this branch so the next run can create a controlled replacement from current main. Do not alter workflows, dependencies, version/release state, review identities, branch protection, or issue state. |
I have successfully repaired integration via a clean, normal, non-destructive merge of the exact current protected main ( |
Merged exact protected main `7516031df533` to resolve diverged ancestry and `CHANGELOG.md` merge conflicts using the authoritative rendering script. Preserved the exact intended #574 MMLE EAP matvec optimizations while avoiding unintended file modifications to essay validation.
|
@opencode-agent address Take a bounded writer lease only if this Draft PR remains exactly Fresh ancestry evidence: Create one controlled Draft replacement from exact protected main and reapply only the unique MMLE slice: Preserve Rust-first production ownership, 512 MiB conservative NumPy-fallback workspace guard, integer 1..100 quadrature validation before response coercion, no |
I have created the requested controlled replacement branch ( |
This commit acts as the controlled ancestry replacement for PR #574. It is rebased purely on exact protected main `7516031df533` to eliminate diverged-ancestry overlap. It reapplies the specific bounded MMLE optimizations: - Replaces explicit N x Q broadcast with a matrix-vector `posterior @ nodes` projection. - Enforces strict 1..100 Gaussian quadrature limits before any large allocations. - Caps the fallback NumPy owned-workspace size (512 MiB constraint) to prevent Denial-of-Service via resource exhaustion when bypassed to CPU. - Extends corresponding regression coverage and canonical documentation.
|
@opencode-agent address Take a bounded replacement-writer lease only after a final refetch proves the source PR is still Draft head Fresh ancestry/diff RCA: this long-lived branch is ahead/behind current main and the PR file list contains seven protected-main-origin paths ( Create exactly one replacement Draft branch from exact protected main, e.g.
Do NOT copy the seven main-origin report/essay files above, old branch CHANGELOG bytes, unrelated formatting/comments, or obsolete process artifacts. Preserve current-main source outside the explicit MMLE/fit hunks. The replacement PR body must record #574 as fail-first lineage and state that old checks/reviews do not transfer. Verification before opening/handing off the replacement: focused MMLE EAP + quadrature preflight tests; relevant MMLE/fit parity tests; changed-production statement/branch coverage with meaningful tests; Rust-primary/default-backend check; changelog fragment contract; formatter/lint and |
I have successfully created the exact bounded replacement Draft branch |
This commit acts as the controlled ancestry replacement for PR #574. It is rebased purely on exact protected main `8db4bf358b0a469915d6c5e336054f4a4f9c6b46` to eliminate diverged-ancestry overlap. It reapplies the specific bounded MMLE optimizations: - Replaces explicit N x Q broadcast with a matrix-vector `posterior @ nodes` projection. - Enforces strict 1..100 Gaussian quadrature limits before any large allocations. - Caps the fallback NumPy owned-workspace size (512 MiB constraint) to prevent Denial-of-Service via resource exhaustion when bypassed to CPU. - Extends corresponding regression coverage and canonical documentation.
|
Supersession revalidated from exact current state; closing this predecessor unmerged now rather than keeping a known-diverged duplicate in the active queue. Fresh evidence:
Closing the PR does not delete its branch, commits, fail-first history, or audit trail, and no #574 check/review/approval transfers to #618. If #618 is later abandoned, reconstruction must start from fresh protected main rather than reviving this diverged merge path. |
Understood. Acknowledging that this work is now superseded by the controlled replacement PR #618 and that this PR is being closed as obsolete. I am stopping work on this task. |
This commit acts as the controlled ancestry replacement for PR #574. It is rebased purely on exact protected main `8db4bf358b0a469915d6c5e336054f4a4f9c6b46` to eliminate diverged-ancestry overlap. It reapplies the specific bounded MMLE optimizations: - Replaces explicit N x Q broadcast with a matrix-vector `posterior @ nodes` projection. - Enforces strict 1..100 Gaussian quadrature limits before any large allocations. - Caps the fallback NumPy owned-workspace size (512 MiB constraint) to prevent Denial-of-Service via resource exhaustion when bypassed to CPU. - Extends corresponding regression coverage and canonical documentation.
Supersession state
This long-lived Draft is not the preferred merge path anymore. It is retained temporarily only to preserve fail-first/history evidence until controlled replacement PR #618 reaches one clean exact-head validation cycle. Do not write new source to this branch, request new review here, or try to make it mergeable by force-push/rebase/churn.
Original buyer-visible slice preserved in replacement
The useful bounded work is:
posterior @ nodes;_fit_mmleto the guarded fallback while preserving Rust-primary production ownership and accepted-problem semantics.Those unique changes were reconstructed from current protected main in #618 without this branch's unrelated historical report/essay paths.
Fresh replacement evidence
Protected
mainis8db4bf358b0a469915d6c5e336054f4a4f9c6b46. Replacement #618 is Draft/mergeable on exact head3b16816b2ef6c847e7c8a88cb1a0e2d14ed94a98; GitHub's synthetic merge with current main iscc6ce0ca0e61e649a210577a43341e40491758ec.On that exact replacement/current-main merge:
1 failed, 2938 passed, 2 skipped, with the sole failure deterministic managed-CHANGELOG.mdparity;A bounded source-writer handoff already owns only current-main reconciliation plus repository-renderer changelog synchronization on #618. Do not race it from this superseded branch.
Closure boundary
Leave this PR open/read-only until #618 has one unchanged exact head with the changelog rendered, full CI/Security/SAST green, fresh current-head automated review, zero valid unresolved findings, and repository approval/protection policy satisfied. At that point close this PR unmerged as superseded by #618, explicitly preserving this branch/history as predecessor evidence; no check/review/approval from this branch transfers to #618.
If #618 is abandoned before clean validation, reassess from fresh protected main rather than reviving this diverged branch by destructive history editing.
Advances the original MMLE NumPy fallback safety slice only through #618.