Skip to content

refactor(linking): replace stale fixed-anchor Rust ownership branch - #737

Closed
seonghobae wants to merge 1 commit into
mainfrom
replacement/fixed-anchor-linking-rust-main-20260811
Closed

refactor(linking): replace stale fixed-anchor Rust ownership branch#737
seonghobae wants to merge 1 commit into
mainfrom
replacement/fixed-anchor-linking-rust-main-20260811

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Controlled clean-lineage replacement for #663 / issue #662

Protected main is 7b57f77747b9a9bd911660c76b1be0ca0dc2d145; this Draft descends directly from that exact protected head. Draft #663 is 197 protected-main commits stale and its only unique path is the fail-first ownership regression carried here. No checks/reviews from #663 transfer.

Intentional fail-first boundary

Commit 3cefab9decf304a93bb2286969079925208fa004 preserves the exact public-boundary RED: link_fixed_item_parameters() must obtain linked theta/alpha/b and scale/shift evidence from a package-owned _core.link_fixed_item_parameters entrypoint. On current protected-main production behavior the sentinel is expected to receive zero calls, proving fixed-anchor transformation arithmetic remains Python-owned. Setup/import/fixture/changelog failure is not valid RED.

Minimum GREEN after current-lineage RED proof

  1. Revalidate the current protected-main fixed-anchor estimand and affine sign/scale convention.
  2. Move the current scale/shift plus linked theta/alpha/b transformation arithmetic into mlsirm-core, reusing an existing Rust primitive only if exact equivalence is proven.
  3. Expose the thinnest _core.link_fixed_item_parameters PyO3 boundary. Python keeps bounded validation, immutable marshalling, MLSIRMParams construction and evidence transport only; missing/incompatible compiled capability fails closed.
  4. Preserve anchor/factor validation, dimensions with no anchors, finite positive slope semantics, xi/zeta/tau, return types and caller immutability.
  5. Add direct Rust↔public parity/property evidence plus deterministic known-affine scale/shift and linked-parameter recovery using bias/MAE/RMSE. Correlation alone is insufficient.
  6. Keep CPU f64 as reference; benchmark before any GPU work.
  7. Add complete rustdoc/docstrings, APA 7 equation/source traceability grounded in Stocking & Lord (1983) and Kolen & Brennan (2014), authoritative changelog material only after GREEN, exact changed-production statement/branch coverage, then one unchanged final head with Python 3.12/3.14, Rust/PyO3, package/reinstall, existing GPU/fuzz, Security Scan, SAST and current-head review evidence.
  8. Canonical Architecture/TRD/ADR/UML/ERD/traceability remains solely docs: establish canonical product and architecture baseline #604/docs: close canonical documentation fitness gaps without parallel authority #621. No dependencies/workflows/version/release/hosted-state or unrelated linking methods belong here.

Once this clean-lineage authority is established, #663 should close as superseded with lineage preserved. Advances #662.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: eeebb426-f713-42d5-a67c-5b2ed55c31e6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Exact bounded GREEN implementation handoff for clean-lineage Draft #737 / issue #662. Final pre-write guard is mandatory: refetch source head 3cefab9decf304a93bb2286969079925208fa004, protected main 7b57f77747b9a9bd911660c76b1be0ca0dc2d145, comments/reviews/threads, and exact python/fast_mlsirm/linking.py / Rust linking / PyO3 target blobs; abort without writing if either ref moved or another writer targets this branch/paths. Preserve the fail-first commit/history; no force push, destructive rebase, temporary writer workflow, or competing canonical documentation branch.

Exact current RED is now proven on synthetic integration 85157da86f993e1064ebbc6244ec7de41556eff1. The CPython 3.12 job built the Rust/PyO3 extension, verified Rust as the resolved production backend, then completed the full suite with exactly 1 failed, 3282 passed, 2 skipped. The only failure is tests/test_linking_fixed_anchor_rust_ownership.py::test_fixed_anchor_linking_delegates_transformation_to_rust because the proposed compiled-core sentinel receives zero calls (len(calls)==0). Rust workspace/PyO3, package/wheel/reinstall/release acceptance, enterprise sales-readiness smoke, GPU-no-skip and fuzz are GREEN. The separately tracked marginal _log_sigmoid RuntimeWarning remains #583/#564 and is not owned here. This is valid runtime RED, not setup/import/fixture/changelog failure.

Implement only the minimum root-cause GREEN:

  1. Re-read current link_fixed_item_parameters() and preserve its exact fixed-anchor affine convention, anchor/factor validation, dimensions-with-no-anchors behavior, positive finite slope semantics, xi/zeta/tau preservation, return types and caller immutability.
  2. Move result-affecting fixed-anchor scale/shift plus linked theta/alpha/b transformation arithmetic into mlsirm-core. Reuse an existing Rust linking primitive only if exact estimand/sign/scale equivalence is demonstrated; do not silently substitute Stocking-Lord/Haebara or another characteristic-curve criterion.
  3. Expose the thinnest _core.link_fixed_item_parameters PyO3 contract. Python may validate bounded shapes/types/IDs, marshal immutable contiguous inputs and construct MLSIRMParams/evidence only. Missing/incompatible compiled capability must fail closed rather than retain independent Python production arithmetic.
  4. Add Rust unit/property tests and direct public Python↔Rust field parity over ordinary one- and multidimensional cases, multiple anchors, dimensions with no anchors, duplicate/out-of-range anchors, malformed factor IDs, extreme-but-finite slopes, non-finite inputs, immutability and stable non-reflective errors.
  5. Add deterministic known-affine linking recovery: recover transformation coefficients and linked item/person parameters with aligned bias/MAE/RMSE. Correlation alone is insufficient.
  6. Keep CPU f64 as reference and benchmark before any GPU proposal; this linking kernel is small.
  7. Ground doctoring/equation traceability in Stocking & Lord (1983), Kolen & Brennan (2014), and any primary source actually governing this fixed-anchor transform. Distinguish simple fixed-anchor affine linking from characteristic-curve methods.
  8. After focused GREEN, add authoritative changelog material and complete rustdoc/docstrings, then run focused linking ownership/robustness/recovery tests, full Python 3.12/3.14, Rust/PyO3, package/reinstall, existing GPU/fuzz, Security Scan, SAST, changelog check and git diff --check on one unchanged head. Keep Draft for fresh current-head review/governance.
  9. Canonical Architecture/TRD/ADR/UML/ERD/traceability belongs only in docs: establish canonical product and architecture baseline #604/docs: close canonical documentation fitness gaps without parallel authority #621 after implementation stabilizes. Do not touch dependencies/workflows/version/release/hosted state or unrelated linking methods.

Stop writing immediately if source/base/writer identity changes.

Copy link
Copy Markdown
Contributor Author

Superseded by clean current-main Draft #752. Fresh compare proved #737 head 3cefab9decf304a93bb2286969079925208fa004 is 30 protected-main commits behind and its only unique path is tests/test_linking_fixed_anchor_rust_ownership.py. The prior OpenCode handoff was explicitly conditional on protected main remaining 7b57f777...; that condition is false, so the write lease is stale. #752 recreates the exact ownership RED from protected main 8a56d7b1b024e18a5a96a94db4ede1bf6648ead1 on head ac6c200fea7e0cb47a870e020faf753a61744b33. No predecessor checks/reviews/approval transfer.

@seonghobae seonghobae closed this Aug 11, 2026
seonghobae added a commit that referenced this pull request Aug 11, 2026
Public link_fixed_item_parameters validates and marshals only; affine
scale/shift and parameter transformation move to the Rust core with
ownership sentinel tests, recovery unit tests, changelog, and APA doctoring.

Supersedes draft #737 once green.
seonghobae added a commit that referenced this pull request Aug 11, 2026
Public link_fixed_item_parameters validates and marshals only; affine
scale/shift and parameter transformation move to the Rust core with
ownership sentinel tests, recovery unit tests, changelog, and APA doctoring.

Supersedes draft #737 once green.
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