small fixes: fold the standing #185 review threads - #191
Conversation
| """Current resident set size in MiB, or None where it is unreadable. | ||
|
|
||
| ``/proc/self/statm`` field 2 is resident pages -- *current* residency, so | ||
| sampling it across a call gives the call's true peak. Only Linux has it; | ||
| elsewhere the caller falls back to the ``ru_maxrss`` watermark, which is a | ||
| lower bound (it reads as no growth whenever an earlier phase out-peaked | ||
| the call). | ||
| """ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #191 +/- ##
=======================================
Coverage 96.34% 96.34%
=======================================
Files 18 18
Lines 1996 1996
=======================================
Hits 1923 1923
Misses 73 73
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
🤖 from Claude Status: both phases are landed and CI is clean — 16 checks passing, 0 failing, with only the long-running "Rust benchmarks" job still going at the time of writing. Marked Left in draft. |
Merging this PR will improve performance by 11.64%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | coverage_square[4] |
164.1 µs | 147 µs | +11.64% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/small-fixes-2026-08-16 (fb4e175) with main (47d9e8a)
Footnotes
-
1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩
Folds the last standing adversarial-review threads from PR #185, which was rebase-merged before they were addressed. espg ruled in session (2026-08-16) that they be folded rather than left standing, so they land here on a fresh branch off
main.Refs #185 (the originating threads):
map_errarm +|e|shadowing inmoc::batchcoverage::batchdoc accuracy (misattached parenthetical, staleCHUNKpeak claim)mortie/batch.py, the conversion-copy floor, and the missing--memharnessRefs #161, Refs #162.
Phases
orderarms (3d95c6f) — the review's live half of r3749046199.--memharness (fb4e175) — the live half of r3749049206.main— see "Already folded" below.What changed
1.
3d95c6f— defence-in-depth arms named.mocs_to_ordershas twomap_err(|msg| format!("moc {i}: {msg}"))arms, atvalidate_batch's budget estimate and in the parallel pass. Both are unreachable: the onlyErrto_order/to_order_countreturn is an out-of-rangeorder, andvalidate_batchopens by refusing!(0..=29).contains(&order). They are kept as defence in depth against a future caller that reaches a kernel without that check, which is not something the next reader can tell from the code — so each now says so in a comment, pointing at the live arm (run_moc's?, a malformed word) next to it. Comment-only; no behavior change.2.
fb4e175— the memory table is re-runnable.polygons_to_morton_mocs' docstring andcoverage::batch's module header quote a measured table (100k footprints → 6.9 MiB input, 12.9 MiB result, 21.9 MiB peak; 555,867 → 38.2 / 71.6 / 112.0), andbenchmarks/measure_batch_coverage.pywas timing-only, so the numbers rested on trust — unlikemocs_and, which citesbenchmarks/measure_mocs_and.py --mem. That script now takes--mem N [order]and reports input, result and peak, plus both ratios, because the peak isinput copy + result + one chunkand quoting it against the result alone omits the binding'sto_vec().It samples
/proc/self/statmwhile the call runs — the method the docstring names, and a true peak rather than a watermark — falling back to theru_maxrsshigh-water mark where/procis absent, with the fallback named in the output so a lower bound is never mistaken for a peak:Both docs now cite the harness at the table.
Already folded — verified, no change needed
Checked each remaining claim against post-merge
mainrather than against the thread text, since1d7a412("fold review: stale CHUNK peak claim, conversion-copy floor, run_moc serial gap") landed between the review and the merge:|e|shadowing (r3749046199 point 2) — already|msg|at both call sites in1d7a412.crate::moc::batch's densify does, and reaches 60x there"; the clauses attach to here, as the review asked.CHUNKpeak claim (r3749047866 point 2) — now "~1.1x ofinput + result(the module header's model; that sweep quoted it against the result alone, which omits the input copy)". The arithmetic checks: 21.9 / (6.9 + 12.9) = 1.11.float32/ lists / non-contiguous slices as adding another on top.Testing
cargo fmt --checkclean;cargo clippy --all-targetsreports nothing on either touched Rust file;cargo test --lib374 passed / 0 failed / 1 ignored.pytest mortie/tests1492 passed / 40 skipped / 0 failed.flake8 mortie --select=E9,F63,F7,F82clean;flake8 benchmarks/measure_batch_coverage.py --max-line-length=88clean.benchmarks/measure_batch_coverage.py --mem 20000 8run end to end (output above).Questions for review
--memcase was verified only on its macOS fallback path — this machine has no/proc/self/statm, so the statm sampler that reproduces the documented numbers is exercised by construction, not by a run. Worth one Linux run before trusting the table's reproducibility end to end.--memaddition answers a review ask for a harness rather than a defect. If it reads as scope creep for a small-fixes PR,fb4e175can be dropped on its own and the two doc citations reverted with it.