feat(psychometric): restore Driver 2017-era T0TOTALVAR extra+p_0 on main - #324
feat(psychometric): restore Driver 2017-era T0TOTALVAR extra+p_0 on main#324seonghobae wants to merge 1 commit into
Conversation
Scalar analog of T0TRAITVAR+T0VAR from commented 2017-era summary.ctsemFit.R (ctsem 2.5.0 line 339). Form t0_trait² · trait inline; do not import unpublished recover_initial_trait_variance. Independent of #321/#322. Zero extra or zero p_0 is kept; 0+0=0. Refuse T0TRAITVAR, T0VAR, TRAITVAR, and addedT0TIPREDVAR t0_b² v.
|
Warning Review limit reachedNext included review available in 9 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
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 |
|
Independent review only. Please review this head ( @coderabbitai review |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Exact head and PR diff summary =='
git rev-parse HEAD
git status --short
git diff --stat HEAD^ HEAD
git diff --name-only HEAD^ HEAD
printf '%s\n' '== Changed-file outlines =='
git diff --name-only HEAD^ HEAD | while IFS= read -r file; do
case "$file" in
*.rs)
printf '\n-- %s --\n' "$file"
ast-grep outline "$file" --items all || true
;;
esac
done
printf '%s\n' '== Full PR diff =='
git diff --find-renames --find-copies --unified=80 HEAD^ HEAD
printf '%s\n' '== Relevant definitions and uses =='
rg -n -i -C 5 \
't0totalvar|t0_trait|t0var|traitvar|recover_initial_trait_variance|event.time|event_time|is_finite|finite' \
--glob '*.rs' .Length of output: 200833 🏁 Script executed: #!/bin/bash
set -euo pipefail
file="crates/psychometric_core/src/event_time.rs"
printf '%s\n' '== Commit metadata and changed paths =='
git show --no-patch --format='commit=%H%nparents=%P%nsubject=%s' HEAD
git diff-tree --no-commit-id --name-status -r HEAD
printf '%s\n' '== Exact patch for T0TOTALVAR symbols =='
git diff --unified=25 HEAD^ HEAD -- "$file" | \
grep -n -E -C 20 'recover_initial_total_variance|InitialTotalVariance|T0TOTALVAR|recover_initial_trait_variance' || true
printf '%s\n' '== Implementation, refusal functions, and tests =='
sed -n '6790,6940p' "$file"
sed -n '16470,16680p' "$file"
printf '%s\n' '== Symbol definitions and crate exports =='
rg -n -C 4 \
'recover_initial_total_variance|InitialTotalVarianceIsNot|recover_initial_trait_variance' \
--glob '*.rs' crates/psychometric_core
printf '%s\n' '== Error enum declarations and display/source handling =='
rg -n -C 3 \
'InitialTotalVarianceIsNot|enum PsychometricError|match self' \
--glob '*.rs' crates/psychometric_core
printf '%s\n' '== All new tests in this commit =='
git diff --unified=3 HEAD^ HEAD -- "$file" | \
grep -n -E -C 8 '^\+.*(fn |recover_initial_total_variance|InitialTotalVariance)' || trueLength of output: 109805 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Focused diffs outside the primary implementation =='
for file in \
ARCHITECTURE.md CHANGELOG.md CLAUDE.md docs/TRACEABILITY.md \
docs/adr/0005-posterior-esem-dsem.md \
docs/research/multilevel-event-time-recovery.md \
crates/psychometric_core/src/lib.rs \
crates/psychometric_core/src/error.rs \
crates/psychometric_core/tests/multilevel_event_time_recovery_contract.rs \
crates/psychometric_core/tests/scientific_claim_boundary_contract.rs
do
printf '\n-- %s --\n' "$file"
git diff --unified=12 HEAD^ HEAD -- "$file" | \
grep -n -E -C 12 'T0TOTALVAR|recover_initial_total_variance|InitialTotalVariance|recover_initial_trait_variance|^\+' || true
done
printf '%s\n' '== Public re-exports of the new boundary helpers =='
rg -n -C 2 'refuse_initial_total_variance' crates/psychometric_core/src/lib.rs
printf '%s\n' '== Explicit sum-overflow coverage =='
rg -n -C 3 \
'recover_initial_total_variance\([^)]*(MAX|1e308)|initial_total_variance.*overflow|extra.*initial_variance.*overflow' \
--glob '*.rs' crates/psychometric_core
printf '%s\n' '== Static arithmetic checks for required boundary cases =='
python3 - <<'PY'
import math
cases = {
"square_overflow": (1e200, 1.0, 1.0),
"extra_product_overflow": (1e154, 1e2, 0.0),
"final_sum_overflow": (1.0, float.fromhex("0x1.fffffffffffffp+1023"), float.fromhex("0x1.fffffffffffffp+1023")),
}
for name, (effect, trait, p0) in cases.items():
squared = effect * effect
extra = squared * trait
total = extra + p0
print(f"{name}: squared_finite={math.isfinite(squared)} extra_finite={math.isfinite(extra)} total_finite={math.isfinite(total)}")
PYLength of output: 199064
I found no blocking defect in the inspected implementation.
Non-blocking test gap: add a case where I did not approve the PR.
|
Outcome
Restores the executable Driver, Oud, and Voelkle (2017) 2017-era
T0TOTALVARscalart0_trait² · trait + p_0on currentmainafter0ce16e8dropped the pre-consolidation code while research notes already named later Driver maps (register items 110–111).Independent of open
#322T0TRAITVARstd,#321unstandardisedT0TRAITVAR,#320Eq. 5 ofT0TRAITEFFECTcarry,#319T0TRAITEFFECTcarry,#318T0TRAITEFFECT,#317T0TDPREDCOV,#316LAMBDAstd,#315/#272TIPREDVARstd,#314DRIFTstd,#313DIFFUSIONstd,#312Kish-weighted CWC,#311discreteDIFFUSIONstd,#310discreteDRIFTstd,#309Eq. 5 ofaddedTIPREDVAR,#308Eq. 5 ofaddedT0TIPREDVAR,#307addedT0TIPREDVAR,#306addedTIPREDVARstd,#305discreteTIPREDEFFECTstd,#304TDPREDEFFECTstd,#303T0TDPREDEFFECTstd,#302T0TIPREDEFFECTstd,#300TIPREDEFFECTstd, and#299asymTIPREDEFFECTstd. Do not stack on those PRs. This crate does not currently exportrecover_initial_trait_variance; form the quadratic extra inline, then add free first-occasionT0VAR.JSS PDF re-opened 2026-08-30T18:50Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104. Table 2 (p. 12
TRAITVAR/T0VAR), §7.1 (pp. 18–19), and p. 16 were read from that PDF. 2017-era ctsem 2.5.0summary.ctsemFit.R(lines 322–339) was re-read locally.TRAITVARφ_ξthe latent trait variance/covariance andT0VARthe latent process initial variance/covariance. Section 7.1 names traits the stable between-subject differences (unit-level unobserved heterogeneity).T0TRAITEFFECTis not in Table 2 or Table 3. The 2017-erasummary.ctsemFit.R(lines 322–331) commentsT0TRAITVAR <- T0TRAITEFFECT %*% TRAITVAR %*% t(T0TRAITEFFECT)with#is this valid?.T0TOTALVAR <- T0TRAITVAR + T0VAR.t0_trait² · trait. The scalar total isextra + p_0.p_0. A zero extra or zerop_0is kept. A zero extra and a zerop_0is exactly zero.trait < 0orp_0 < 0fails closed.T0is an event-time occasion, so a non-event clock fails closed. An overflowing product or sum fails closed.T0TRAITEFFECTand freeT0VARdo not require stablea < 0.t0_trait² · traitisT0TRAITVARand equals this total whenp_0 = 0and remains a distinct named quantity.p_0isT0VARand equals this total when the extra is 0 and remains a distinct named quantity.TRAITVARequals this total whenT0TRAITEFFECT = Iandp_0 = 0and remains a distinct named quantity.t0_b² visaddedT0TIPREDVARand is extra first-occasion TI variance, not this total.Meredith (1993) remains unread (Unpaywall 2026-08-30T18:40Z:
is_oa: false; OpenAlex closed; Springercontent/pdfis an HTML stub). Mislevy (1991, Psychometrika, 56, 177–196) remains unread on the same terms (DOI10.1007/bf02294457).Still not a Kalman filter, not a matrix
expm, not ESEM estimation, not DSEM, and not ctsem estimation.Local
cargo test -p psychometric_core: 189 lib tests, 110 multilevel tests, 53 scientific-claim tests, plus crate/ESEM/plausible/Rubin contracts, all passed.cargo clippy -p psychometric_core --all-targets -- -D warningspassed.Do not squash-merge without independent non-author APPROVE plus exact-head required-check success. Do not self-approve. Do not wait on Checks for this or sibling psychometric PRs.