Skip to content

perf(shared-fs): remove unused recursive history depths - #342

Draft
peerbit-org wants to merge 1 commit into
masterfrom
cleanup/shared-fs-unused-depth-20260905
Draft

peerbit-org wants to merge 1 commit into
masterfrom
cleanup/shared-fs-unused-depth-20260905

Conversation

@peerbit-org

Copy link
Copy Markdown
Collaborator

Summary

Small master-based cleanup, independent of held #331/upstream upgrade: remove unused recursive history-depth computation and private depth maps. Keep head filtering and all stored-causalDepth/non-delete/ID winner rules unchanged. No new cache, API/schema change, dependency change or replication-policy change.

The new pre-change regression exposed Maximum call stack size exceeded for a 20,000-event reverse-ordered naming history. Removing the unused recursion fixes it; both naming and content deep-chain cases now pass.

Verification

  • 23 new deterministic cases pass: exact heads under permutations, forks/merges, missing/retired ancestors, stored-depth and ID ordering, naming non-delete bias, existing malformed-cycle behavior, deep reverse chains.
  • Independent code/test review, library build, ESLint and formatting pass.
  • Package dry-run: 2,203,473 unpacked bytes / 492,964 compressed, under budget, no test files included. No publish.
  • A matched synthetic warm-head microbenchmark (60 samples after10 warmups per case; separate processes, baseline first) showed 10k-row naming p50 1.510→0.695ms, content1.711→0.802ms. Component-only, no IO/network/mount claim, no guaranteed speedup; O(history) remains. Raw evidence is preserved locally.

HOLD — strict full run failed

The full library suite used the opt-in runner/reporter from #340 via explicit config path, without changing its budgets. It reported542 eventual passes /10 skipped, but correctly exited1 on one actual persistent-multi-writer retry (missingInstrumentation:0). Do not treat that as a clean run or merge this draft.

First failure: expected undefined to be defined from persistedReceiptPeerSession(remoteHash) at persistent-multi-writer.test.ts:100, reached from line400's Promise.all index1 after restart/convergence and before prepareForDisposal. The remote identity was not captured. This resembles the prior older-cohort readiness failure category; it is not a new proof of latest-cohort failure, data loss, or a proven identical root cause.

All23 new tests and existing shared-fs31 /GC14 /compaction6 /durable-disposal22 cases passed without retries. No local or CI rerun, timeout inflation, assertion weakening or check bypass. Ordinary CI on this branch does not yet include #340's strict gate; a green result there does not clear this recorded hold.

Local raw evidence: /private/tmp/peerbit-performance-20260905/unused-depth-library-strict.log (first failure line230), unused-depth-baseline-regressions.log, unused-depth-after-regressions.log, unused-depth-baseline.raw.log, unused-depth-after.raw.log.

All git/GitHub actions as verified peerbit-org. No upstream writes or release.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant