Skip to content

applied: MatR::zero_matrix contents are unpinned — filling one() instead of zero() reddens nothing #371

Description

@tsondru

Provenance: G4-T4 (#301) review, 2026-08-27. Not introduced by that diff.

Perturbing MatR::zero_matrix (src/mat.rs:77) to fill R::one() instead of R::zero() reddens nothing workspace-wide (146 binaries, 0 failed). Its call sites read shape or a property the fill does not change: the round-trip oracle is S(mat_to_sfg(M)) == M for whatever M the constructor produced; try_inverse_of_singular_is_none (tests/mat_f64.rs:178) holds for an all-ones 2×2 too; mat_kron.rs:273 and trace.rs:139 use it for shape.

Fix: pin the entries directly — zero_matrix(2, 3).entries() all R::zero(), on at least one rig whose zero is not 0.0 (Tropical::zero() is +∞).

MatKron::zero_matrix (src/mat_kron.rs:82) delegates and inherits the gap.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit-sweep2026-08 audit sweep: paper/test-layer audit findings

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions