fix: resolve issue 566 Phase 0 soundness and blocking panic audit (PR1) - #589
Merged
Conversation
Sources are resolved per Make rule against the exact artifact output; an unrelated rule can no longer satisfy an artifact's source validation. Nested macro_rules! definitions inside a transcriber are recognized so their matcher patterns (a name, not a call) are excluded while real transcriber invocations are still reported.
…isapprox rejection Also correct the norm_squared doc: the LASSQ accumulation is inherently nonnegative, so the stale finite-negative-roundoff clamp claim is removed.
- All Materialized scaling now converts only the compact payload and returns compact storage, so untracked scaling no longer traverses unreferenced strided-gap backing entries (drops the whole-backing Storage::scale path). - to_dense_*_col_major_vec reject logical-dim product overflow instead of silently returning an empty buffer. - Regression tests: untracked strided structured scale stays compact, dense overflow fails closed, unmatched support in both operand orders, exact-mode and structured-payload NaN rejection, zero-vs-nonzero rtol.
…ssion - StructuredStorage::logical_dense_col_major_vec now returns StorageResult and fails closed on logical-dim product overflow through checked_logical_len; the two Storage to_dense_* wrappers propagate it. - The untracked structured-scale regression now uses genuinely gapped storage (strides [3,1], five backing entries with an unreferenced gap) and asserts the result collapses to Dense compact storage with the correct referenced values, so reintroducing the whole-backing scale path (which preserved the gap as Structured storage) fails the test. Correct expected payload order for the strided offsets.
…iation # Conflicts: # .github/workflows/CI_rs.yml # .github/workflows/CI_rs_selfhost.yml
- matrix: reject overflowing multiplication output before backend call - quanticstci: reject empty discrete grid size instead of panicking - capi: bound index-pointer array byte length; validate structured/diag payload lengths against metadata before copying - tcicore: use checked block shape products in matrixluci sources - scanner: recognize assert_eq/assert_ne/debug_assert_eq/debug_assert_ne; reviewed baseline grows from 14 to 23 entries - self-test: cover comment/rustdoc exclusion, private-helper classification, and stale-baseline failure
The fallible TensorVectorSpace surface (norm_squared/norm/maxabs/isapprox) had dropped core/src/tensor_like.rs below the 75% CI gate (75.2% -> 70.0%). NaN-input tests exercise the trait error propagation for TensorDynLen, and a BlockTensor test exercises the trait-default isapprox (sub mismatch and NaN norm failure). Debug coverage restored to 80.6%; 207/207 files pass. Also gitignore .pi-subagents/ session infrastructure (it tripped the repository-rules-review sensitive-diff scan) and pin the panic-audit tool coverage with _comment_tooling rationale for Task 12.
Repository rules reviewRepository rules review (32852babf0873a8a68da47baa35463208af98d63...62ddc3204b43c299a958fdcd1c4763cb4a83adcc) Verdict: pass Findings: - [warn] llm-skipped (External LLM Review) <unknown>: External LLM review was skipped Skipped by rules-review:no-llm label after maintainer review. |
f-string expressions contained backslashes (Python 3.12+ only); precompute the fixture line numbers so ubuntu-22.04's Python parses the file.
shinaoka
enabled auto-merge (squash)
August 10, 2026 03:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves issue #566 Phase 0 (soundness hotfixes) and the Phase 1
blocking library-panic audit. Implements PR 1 of
docs/superpowers/plans/2026-08-08-issue-566-pr1-soundness-ci.md(Tasks 1–8)plus the Task 13 integration round (sync, dual review, full validation).
Phase 0 soundness fixes (issue #566)
tensorbackend): checked shape products in allconstructors; axis-checked
Index/IndexMut(no morem[[3,0]]aliasingm[[1,1]]); multiplication output shape validated before the backend call.tcicore): real validation at therrlu/rrlu_inplaceentry,no longer debug-only;
matrixluciblock shape products checked.silently injecting
V::default(); empty discrete grids error instead ofpanicking; invalid initial pivots surface as errors.
capi): checked dimension products,isize::MAXbyte bounds onraw slices and index-pointer arrays, and metadata-before-allocation for
structured/diagonal constructors (new
Storage::validate_structured_metadataseam — no duplicated validation).
only after child-group consistency; constant-space attribute lookup.
checked_multivar_dimsshared by all multivariableoperators; no unchecked
1 << nvariablesremains.Phase 1: blocking, source-aware panic audit
scripts/audit-library-panics.py+tools/library-panic-auditare wiredinto CI as a blocking gate (self-test + audit steps).
reviewed public-path assertion baseline (assert/assert_eq/assert_ne/
debug_assert variants; 23 entries, stale entries fail, raw entries can never
be baselined).
CI_rs.yml(uses thecicargoprofile from build: drop full debug info from default profiles #581–Reduce CI build artifact size #587 to keep CI artifacts small) and added to the rollup.
Task 13 integration
origin/main(merged build: drop full debug info from default profiles #581/build: omit debug info from ordinary release builds #586/Reduce CI build artifact size #587).Sol family): no Blocking findings; 7 Important findings fixed and re-verified.
-D warnings, nextest 2689/2689, doctests 840,mdBook, cargo doc, scanner 11/11 + audit 0 unbaselined / 0 stale,
repository-rules review, debug llvm-cov 207/207 files (coverage
regression in
core/src/tensor_like.rsfrom the fallible-API cascade wascaught and restored 70.0% → 80.6%).
Recorded decisions (see worklog)
CI_rs_selfhost.ymlretired (repo-owner-authored commit; it only ran asubset of the restored test job and its self-hosted runner was never active).
private-helper assertions are classified outside that surface per the plan's
scanner design (documented in
tools/library-panic-audit/src/audit.rs;extending to all functions is a PR 2 candidate).
_comment_toolingcoverage rationale pins the panic-audit tool files (theyare exercised deterministically by subprocess self-tests that llvm-cov
cannot attribute);
treetn/dmrgrelease-only deficit is pre-existing anddeferred to Task 12.
Out of scope (later PRs)
Tasks 9–12 (incremental API-doc/crate-boundary gates, doctest/kryst cleanup,
debris deletion, release-coverage switch), the shared-rules prerequisite
tensor4all-agent-rules#6, and the remaining Phase 1–5 backlog.