Repository navigation
t27o: pay down the duplicate bodies of the A2 methods -- slice contains is bytes_contain for u8 only, saturating_add_u64 on checked_add_u64 (Closes #10764) - #10817
Conversation
…ns is bytes_contain for u8 only, saturating_add_u64 is built on checked_add_u64 (Closes #10764) tools/dupe_scan.py named two new groups on #10801. Both are gone: - contains_u16 .. contains_f64 (ten fns, the body of bytes_contain once the types are normalised; t27 has no generics to share it) and their ten tests are deleted. A slice `contains` converts only when the element type is u8, through bytes_contain. Any other scalar element type is refused with a reason of its own, R_SLICEGEN: "slice contains on `u32` at line N: no generic helper, and per-type copies are refused by the DRY ratchet". The std table loses the per-type row; a negative control pins the refusal on a u32 slice, a Vec<u16> and an f64 slice, and the slice-of-texts control stays. str_contains_char duplicates nothing and stays. - saturating_add_u64 was byte-identical to hosting::panel's saturating_add. It is built on this module's checked_add_u64 now (a `use` of panel splices 28 modules and clashes with toolchain's starts_with / ends_with). The other saturating_* fns were not in any group. dupe_scan: "duplicate bodies: 682 of 13593 in 195 group(s)", ok, no new group and none grew; `--like specs/tools/t27o/rust_std.t27`: nothing in this file is written elsewhere. The ledger was not blessed. Tests: t27b 51 / 51 and 129 / 129, test-report vacuous 0 of 51 and 0 of 129, coverage of rust_std.t27 149 of 149, both seals re-saved and verified. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review (orchestrator, Opus): this pays down the duplicate bodies that #10801 brought to master (it merged at its old head; its auto-merge had been switched off for exactly this and was switched back on at 03:21:53Z from the shared account, not by this loop). Re-ran on 9aaa635: |
Follow-up to #10801. That PR was squash-merged at its pre-fix head (11b672a) at 03:22:44Z, after auto-merge was enabled and before the dedup fix at 05b4785 reached it, so master (72f1280) carries the two duplicate groups
tools/dupe_scan.pynames: "a body written under bytes_contain is now copied [11] time(s)" and "a body written under saturating_add is now copied [2] time(s)". This PR is that fix commit on top of master, unchanged. Closes #10764.contains_u16 .. contains_f64(ten fns, the body ofbytes_containonce types are normalised) and their ten tests are deleted. A slicecontainsconverts only on a u8 element, throughbytes_contain; any other scalar element type is refused with its own reason: "slice contains onu32at line N: no generic helper, and per-type copies are refused by the DRY ratchet" (R_SLICEGEN). Negative controls pin it on a[u32], aVec<u16>and a[f64]; the slice-of-texts control stays.str_contains_charduplicates nothing and stays.saturating_add_u64was byte-identical tohosting::panel'ssaturating_add; it is built onchecked_add_u64now. No othersaturating_*fn was in a group.Checks, run on this branch:
python3 -I tools/dupe_scan.pyexit 0, "duplicate bodies: 713 of 13911 in 203 group(s) across 2375 spec(s)", "ok: no new duplicate body, and none of the known groups grew";--like specs/tools/t27o/rust_std.t27: nothing in this file is written elsewhere; the ledger is not blessed.t27b test51 passed (rust_std) and 129 passed (rust_convert);t27c test-reportvacuous passes 0 of 51 and 0 of 129 (run on the identical content before the cherry-pick);t27c coverage specs/tools/t27o/rust_std.t27149 of 149; both seals--verifymatch; the gen file is byte-identical tot27c gen-rustof the spec;cargo check -p triclean;check_devhome_paths.pyOK.Corrected measure (tri from this content, master tri b94c869; method first refusals before -> after): count_ones 8 -> 6, trailing_zeros 1 -> 0, leading_zeros 3 -> 2, pow 8 -> 0, saturating_add 21 -> 9, saturating_sub 29 -> 5, saturating_mul 2 -> 1, div_ceil 12 -> 7, sqrt 49 -> 3, ln 14 -> 0 (14 in the libm kind), is_finite 12 -> 2, to_bits 12 -> 5, is_ascii 12 -> 1, unwrap_or 14 -> 8, get 68 -> 67, contains 124 -> 120 (+7 in the new slice-contains kind); all methods 3207 -> 3078. Converted fns 1830 -> 1889, converted tests 648 -> 668, no file converts fewer.
Auto-merge is not enabled on this PR.
🤖 Generated with Claude Code