Skip to content

MaximizeParsimony()'s own XFORM report block calls TreeLength() on its own collapse output, so it is one T-330 revert away from T-400 — and T-330's fix-by-disabling is the ONLY thing shielding it. #17

Description

@ms609

Severity: P3 · Area: 11 (Collapse), 10 (HSJ/XFORM kernels)

Location: R/MaximizeParsimony.R:1711-1716; guard relied upon at src/ts_collapsed.cpp:153-157; emitter at src/ts_rcpp.cpp:225-260

The block does TreeLength(structure(outTrees, class = "multiPhylo"), ...) on the post-collapse trees. Verified REAL as latent (opus verifier): src/ts_rcpp.cpp:2238 calls compute_collapsed_flags_aggressive, which returns all-zero for ScoringMode::HSJ/XFORM at ts_collapsed.cpp:153-157before the total_words == 0 star branch and before the has_na delegation — and tree_to_collapsed_edge contracts exactly the flagged nodes, so all-zero flags is the only reason outTrees stay binary here. There is no useXform guard on the collapse block (:1629), no post-hoc binary check, and the length(outTrees) == 0L fallback treeTpl is binary. Both predicted failure modes were driven with the T-330 test fixture (whose EW arm genuinely collapses, nEdge 10 -> 8): mixed nEdge -> Error: Trees have different numbers of edges (10, 8); uniform nEdge -> silent wrong number (TreeLength(<1 polytomous tree>, ds, inapplicable = "xform", hierarchy = h) returned 1 against a binary reference of 2; the EW control returned 0 for a tree whose char 1 0,0,0,1,1,1 forces >= 1 step). Held P3, and filed separately from T-400 for one reason only: T-400's root-cause fix converts this from silent garbage into a hard error inside MaximizeParsimony() on its own output, so it still needs its own handling and must not be assumed closed by T-400's patch. Whoever lifts T-330's HSJ/XFORM no-op (the documented next step for that fix) must revisit this call site in the same change.


Migrated 2026-08-04 from dev/red-team/findings.md; pre-tracker ID T-401. References to T-401 in source comments, dev/red-team/log.md, commit messages and PR bodies mean this issue — see dev/red-team/migration-map.tsv. Cross-repo references use the fully-qualified form agent-issues/TreeSearch#<n>; a bare #n means this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:10Red-team focus area 10area:11Red-team focus area 11in-progressBeing fixed; claiming comment names the branchred-teamFiled by the /red-team rotationsev:lowP3: robustness / polish

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions