● refactor core #516
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq!516
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor-core"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
crates/core/src session recap: all 4 HIGH and both MEDIUM items audited.
(fmt_variant/fmt_map — depth 6→3), memory_stats.rs (atomic_max helper),
son.rs (child_indent — collapsed the pretty/compact duplication),
tagged_stack.rs (stack_layout — unified the 5 layout sites for
alloc/dealloc soundness).
Every step verified green (clippy clean, 80 seq-core / 1140 workspace tests
passing). The checklist at tmp/rust-audit-crates-core-src.md reflects all
of it, with deferred cross-file notes recorded (the
stack/{convert,shuffle}.rs split, pop_two's stale param,
is_tagged_heap/MemorySlot visibility, sharing atomic_max with
scheduler.rs).
Remaining whenever you pick it back up: the 2 LOW files (arena.rs,
error.rs) in core, plus the MEDIUM/LOW/test buckets still open in the
compiler checklist. Cheers!
crates/core/src session recap: all 4 HIGH and both MEDIUM items audited. - Refactored (5): stack.rs (is_inline helper), value.rs (fmt_variant/fmt_map — depth 6→3), memory_stats.rs (atomic_max helper), son.rs (child_indent — collapsed the pretty/compact duplication), tagged_stack.rs (stack_layout — unified the 5 layout sites for alloc/dealloc soundness). - Reviewed clean, no changes (1): seqstring.rs. Every step verified green (clippy clean, 80 seq-core / 1140 workspace tests passing). The checklist at tmp/rust-audit-crates-core-src.md reflects all of it, with deferred cross-file notes recorded (the stack/{convert,shuffle}.rs split, pop_two's stale param, is_tagged_heap/MemorySlot visibility, sharing atomic_max with scheduler.rs). Remaining whenever you pick it back up: the 2 LOW files (arena.rs, error.rs) in core, plus the MEDIUM/LOW/test buckets still open in the compiler checklist. Cheers!Review — approve, no blockers
Small, tight refactor (+92/−89, 5 files in
crates/core/src). Reviewed each diff behavior-by-behavior; all are behavior-preserving and two improve memory-safety hygiene.tagged_stack.rs— the standout. The 5 independentLayout::array::<StackValue>(cap)sites (alloc innew/clone_stack, realloc old+new ingrow, dealloc inDrop) now route through onestack_layout(). This eliminates the class of bug where one site's layout computation drifts from another's → alloc/dealloc UB. Soundness-positive; only the panic message changes (now uniform).stack.rs—is_inline(sv)consolidates the memory-safety-critical "tagged int or bool, elseArcpointer" predicate used at 3 decode sites (clone_stack_value,drop_stack_value,heap_value_mut). Same upside: the three guards can no longer diverge.memory_stats.rs—atomic_maxextracts the CAS-max loop; identical logic, and the note about sharing it withscheduler.rs'sPEAK_STRANDSis correctly left as a deferred cross-crate follow-up.son.rs—child_indentcollapses the pretty/compact duplication acrossformat_variant/format_list/format_map. Traced all four cases per function (pretty/compact × empty/non-empty); the dropped earlyreturns for empty collections are equivalent because the loops don't iterate, and the trailingnewline_at_indent(depth)is correctly re-guarded bypretty && !empty. Output byte-identical.value.rs—fmt_variant/fmt_mapextracted from theDisplayimpl (nesting 6→3).fmt_varianttrades the twoif !emptyparen guards for an earlyreturn Ok(())on empty then unconditional parens — same output.Deferred cross-file notes in the description (
stack/{convert,shuffle}.rssplit,pop_two's stale param,is_tagged_heap/MemorySlotvisibility, sharingatomic_maxwithscheduler.rs) confirmed not addressed here — correctly out of scope.Note on process: reviewed by diff inspection against
main; did not re-runjust cion this branch locally. The PR's clippy-clean + 80 seq-core / 1140 workspace passing claim is consistent with these provably behavior-preserving changes.