Skip to content

docs: Explorer parity + native-feel performance plan#304

Draft
joesobo wants to merge 165 commits into
mainfrom
feat/explorer-parity-performance-plan
Draft

docs: Explorer parity + native-feel performance plan#304
joesobo wants to merge 165 commits into
mainfrom
feat/explorer-parity-performance-plan

Conversation

@joesobo

@joesobo joesobo commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Handoff plan for the Trello epic Epic: VS Code Explorer parity + native-feel performance, written for an autonomous executor (GPT 5.6 looping on a dedicated Mac mini) — docs/plans/2026-07-08-explorer-parity-performance.md.

Nine phases with deterministic gates, plus a cited research appendix (Obsidian graph internals + plugin system, VS Code standards, react-force-graph/d3-force/tree-sitter levers) and code-audited monorepo facts (confirmed gaps: no incremental tree-sitter parsing, per-call parser construction, zero worker_threads, Graph Scope toggles round-trip to the host).

  1. In-window metrics harness — real VS Code via the existing @vscode/test-electron setup; same-session built-in Explorer ratio lane; new giant fixture (30k files, past Obsidian's documented ~25k ceiling); idle-CPU and sim-tick metrics
  2. Explorer feature parity — inventory-driven, validation standards V1–V8
  3. Performance — diff protocol, zero layout resets, optimistic ops, tree-sitter incremental parse + parser registry + worker-pool cold index, ladybugdb idle-time patch writes, sim/render budget (settled graph ≈ 0 CPU vs Obsidian's 8–20% idle), worker-thread simulation as the last rung before any PixiJS discussion (owner decision, never autonomous). Gate 3-J: interactive at 30k files
  4. Graph Scope & projection flow — warm toggles are webview-local masks (0 host round-trips, 0 cache writes, 0 layout resets); chunked hydration protocol; diff edges as a maskable class; symbols spawn at their file's position
  5. Desktop interaction model — marquee on plain background drag, Ctrl-drag pan, physical group drag (edges tug neighbors), selection-wide context menus with count headers
  6. Feel & polish — settings matrix, inline rename/create, ghost-graph cold open, dialog copy audit
  7. Plugin ecosystem — Obsidian's lifecycle/disposal/manifest/template/dogfood model + VS Code's declarative contributions and lazy activation; Material Icon Theme extraction as the API-sufficiency proof; ≤50ms activation budget per plugin
  8. Proof & showcase — Explorer side-by-side recording, Obsidian-limits comparison table (cited), physicality reel; owner sign-off gates cleanup
  9. Cleanup & hardening — post-validation scaffolding sweep, scoped quality pass, docs, baseline rebase

Quality tooling uses the repo's first-party @poleski/quality-tools loop (crap → scoped mutate → split-if-over-threshold → organize → repeat until clean); full-suite mutation explicitly excluded.

Review notes

  • Gate 3-J (30k files: settle ≤15s, drag ≥30fps, idle <2% CPU) is the beat-Obsidian headline — sanity-check it.
  • Drag-file-to-folder and external OS drop remain deferred to a future epic (follow-up card filed in Phase 8); Phase 5 covers canvas interaction semantics per your spec.

🤖 Generated with Claude Code

Detailed 4-phase plan for the Explorer-parity epic (https://trello.com/c/hmVekNGe)
with deterministic checkpoint gates per phase.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f6e6062

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@codegraphy-dev/extension Minor
@codegraphy-dev/core Minor
@codegraphy-dev/plugin-svelte Patch
@codegraphy-dev/plugin-typescript Patch
@codegraphy-dev/plugin-vue Patch
@codegraphy-dev/plugin-api Minor
@codegraphy-dev/mcp Patch
@codegraphy-dev/plugin-godot Patch
@codegraphy-dev/plugin-markdown Patch
@codegraphy-dev/plugin-material-icons Patch
@codegraphy-dev/plugin-particles Patch
@codegraphy-dev/plugin-unity Patch
@codegraphy-dev/sample-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

joesobo and others added 18 commits July 8, 2026 14:49
- Renumber phases linearly (metrics harness is now Phase 1)
- Add full Explorer parity inventory as source-of-truth table
- Add Explorer validation standards V1-V8 as testable gates
- Add monorepo package impact matrix and testing strategy
- Waive arrow-key navigation (owner decision)
- Split drag & drop into its own revisit phase with dogfood spike
- Add Phase 6 proof/showcase and Phase 7 post-validation cleanup

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…f work

- Perf truth is now a launched VS Code window (@vscode/test-electron) with
  same-session built-in Explorer ratio comparisons; no headless perf anywhere
- Remove drag & drop phase entirely (deferred to future epic; follow-up card
  filed in showcase phase); renumber to 6 phases
- New dependency-maximization tasks: tree-sitter incremental re-parse +
  worker-pool cold index, ladybugdb patch-only writes off the interaction
  path, d3/react-force-graph simulation budget + sprite caching + LOD
- Quality-tool loop documented: scoped/differential mutation only, mutation-
  site thresholds as a split-the-file signal, organization tool after,
  iterate until outputs are clean

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…n model, plugin ecosystem

- Research appendix: Obsidian graph internals (PixiJS/WebGL, ~25k ceiling,
  main-thread sim bottleneck, idle CPU, MetadataCache decoupling, plugin
  lifecycle/manifest/template model) with sources; VS Code standards;
  react-force-graph + d3-force + tree-sitter levers
- Code-audited monorepo facts: no incremental tree-sitter parse, per-call
  parser construction, zero worker_threads, scope toggles round-trip to host
- New giant fixture (30k files) + gate 3-J to beat Obsidian's documented
  limits on react-force-graph, with worker-sim rung before any PixiJS talk
- Phase 4: Graph Scope/projection flow (webview-local masks, hydration
  protocol, diff edges) with frame-budget toggle gates
- Phase 5: desktop interaction model per owner spec (marquee default,
  Ctrl-drag pan, physical group drag, selection-wide context menus)
- Phase 7: plugin ecosystem modeled on Obsidian + VS Code patterns
- Executor reframed for GPT 5.6 autonomous loop on dedicated Mac mini;
  superpowers references replaced with Matt Pocock's skills

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pnpm perf -- --smoke --fixture small --runs 1 --no-budget

Before: unavailable (no in-window harness)

After: coldOpenMs=1967.70 ms to PHYSICS_STABILIZED on VS Code 1.128.0 (single smoke run; not a baseline)
Add same-profile cold/warm launches, deterministic Git fixture states, production indexing, and armed Core/extension metric emitters.

Before (discovery-only smoke, not comparable): small coldOpenMs 1967.70ms; warm and cache metrics unavailable.

After (full indexed relationship graph): small coldOpenMs 3371.25ms, warmOpenMs 1575.39ms, cacheSaveMs 456.20ms, cacheBytes 2207744. Single local run; not a baseline.
Before (small indexed fixture, one local run): cold 3371.25 ms, warm 1575.39 ms, with 100 individual parse records emitted.

After (small indexed fixture, one local run): cold 3419.17 ms, warm 1541.08 ms, with Tree-sitter records aggregated by dimension. These samples are directional and are not the checked-in baseline.
Before (small indexed fixture, one local pair): cold 3419.17 ms, warm 1541.08 ms, cache save 472.17 ms.

After (small indexed fixture, one local pair): cold 3094.79 ms, warm 1601.78 ms, cache save 446.64 ms. These samples are directional and are not the checked-in baseline.
Add strict same-window Explorer comparisons, correlated scope and webview scenarios, deterministic self-workspace support, report assembly, stability budgets, and the PR performance workflow.

pnpm perf -- --fixture small --runs 1 --no-budget

Before: cold 3419.17ms, warm 1541.08ms, cache save 472.17ms.

After: cold 3348.73ms, warm 1560.29ms, cache save 453.73ms. The post-refactor scope probe measured 108 transitions across 18 rows with 108 unique operation IDs and a 154.66ms maximum.
Before: editor-visible create timed out and produced no complete medium report.

After (pnpm perf, medium): 10/10 scenarios complete; rename 826.284ms vs Explorer 4.012ms, create 822.224ms vs 11.310ms, delete 820.020ms vs 7.229ms; idle 0 ticks at 60.0fps.

joesobo commented Jul 10, 2026

Copy link
Copy Markdown
Owner Author

Checkpoint pushed: 439ced693 (fix(perf): keep graph visible during Explorer benchmarks).

The benchmark now opens CodeGraphy as an editor panel in column 2, keeps a real workspace editor in column 1, subscribes to the visible editor-panel bridge, and asserts the graph stays visible before/after Explorer samples. The create→undo failure was traced to the created file replacing the active graph tab; the perf runtime now focuses the column-1 document before exercising the production mutation path. Refresh waits now have separate activity-start and settlement deadlines.

Fresh editor-visible pnpm perf -- --fixture medium --runs 1 --skip-stability --no-budget result: all 10 scenarios completed.

  • CodeGraphy file-op: rename 826.284 ms, create 822.224 ms, delete 820.020 ms
  • Same-window Explorer: rename 4.012 ms, create 11.310 ms, delete 7.229 ms
  • Idle: 0 ticks after settle, 60.0 FPS, 4.55% process CPU
  • Drag: 34.95 FPS; long tasks/interaction: 0
  • Current payload: 497,876 bytes; layout resets: 33

The ratios are intentionally ugly now that the comparison is honest; they are the Phase 3 optimization baseline.

Verification: 129 perf tests, 105 focused extension tests, perf + extension lint/typecheck, acceptance ownership guard, and repo-wide pre-commit typecheck all green.

Live progress: https://codegraphy-pr304-progress.poleski.chatgpt.site

Before: giant --symbols built 540000 nodes and 569996 edges, then timed out waiting for PERF_RENDER_READY after 180000ms without a report.

After: the editor-visible giant --symbols cold open completes in 193260.878ms (cacheSaveMs 117325.108); large --symbols completes in 32652.950ms. Full evidence stays available while react-force-graph renders an interactive file overview.
@joesobo

joesobo commented Jul 10, 2026

Copy link
Copy Markdown
Owner Author

Checkpoint pushed: 2a7ac36 (perf: correlate visible giant graph readiness)

What changed:

  • host-assigned graph revisions now correlate GRAPH_DATA_UPDATED → render-ready request → painted response, including request-ahead-of-payload races
  • readiness is acknowledged only after engine stop and a subsequent 2D canvas frame
  • oversized symbol evidence stays available to the app, while react-force-graph receives an interactive file/folder overview
  • pointer, physics, and accessibility work now have node/edge/DOM budgets; omitted accessibility items are announced

Real editor-visible measurements:

  • Before: 540,000 nodes / 569,996 edges built, then PERF_RENDER_READY timed out after 180,000ms; no report
  • After: giant --symbols cold open completed in 193,260.878ms (cacheSaveMs 117,325.108ms)
  • large --symbols cold open completed in 32,652.950ms

Fresh verification:

  • 136 focused extension tests passed
  • 129 perf-harness tests passed
  • extension lint + typecheck passed
  • repo pre-commit typecheck and acceptance ownership guard passed

Progress site (newest first): https://codegraphy-pr304-progress.poleski.chatgpt.site

Next: finalized Phase 1 five-run medium baselines, full sweep, Linux runner baselines, then restore budget-enforcing small+medium PR CI.

joesobo added 2 commits July 9, 2026 23:15
Carry a monotonic scope-projection revision through toggle completion, graph commits, and physics settling so the perf harness cannot accept stale or unrelated readiness events. Preserve layout-change intent across coalesced commits and keep cancelled render callbacks inert.

Split the correlation, projection, lifecycle, and target logic into focused modules with direct unit and mutation coverage.

Verification: extension tests 7,035/7,035; perf harness tests 129/129; changed logic mutation score 100%; lint, typecheck, and perf build passed. Five medium samples improved node:folder scope-toggle median from 175.22 ms to 125.04 ms and CV from 14.22% to 1.35%. The full command completed all scenario hosts but remains gated by unrelated local Explorer delete CV of 12.93% (8.19-11.45 ms), which will be rerun.

joesobo commented Jul 10, 2026

Copy link
Copy Markdown
Owner Author

Checkpoint pushed: 6ff3618da5d2e1c8336d5a0b6ad6f7176a250b96perf: correlate graph scope readiness exactly.

What landed:

  • monotonic scope-projection revisions carried through toggle completion, graph commit, and physics settling
  • causal readiness matching (stale settlements can no longer satisfy later graph commits)
  • coalesced commits preserve layout-change intent; cancelled callbacks stay inert
  • focused module splits with matching tests

Verification:

  • extension: 7,035/7,035 tests passed
  • perf harness: 129/129 tests passed
  • changed logic: 100% mutation score
  • lint, typecheck, perf build, acceptance ownership guard, and pre-commit checks passed

Editor-visible medium evidence:

  • node:folder scope median: 175.22 ms → 125.04 ms (28.6% faster)
  • scope CV: 14.22% → 1.35%
  • every VS Code scenario host completed with exit 0 and CodeGraphy visibly open

The aggregate command still exited nonzero on a separate local Explorer baseline stability check: explorerDeleteMs drifted monotonically 8.19, 8.98, 9.69, 10.40, 11.45 ms (CV 12.93%, limit 10%). Two prior diagnostic captures were stable at 7.43% and 6.77%, so I’m treating this as a recapture gate—not accepting/adopting the stale aggregate. Next step is a clean five-run medium recapture, followed by the small local-reference capture.

@joesobo joesobo marked this pull request as draft July 10, 2026 15:36
Reduce small-fixture watcher-to-graph save latency from 563.6 ms to 110.1 ms (80.5%) by suppressing the full atomic watcher burst after a document save. Enforce exactly one correlated single-save measurement in performance reports.

joesobo commented Jul 10, 2026

Copy link
Copy Markdown
Owner Author

Checkpoint — atomic saves now refresh once

Pushed 3ab64fe5d (fix(perf): collapse atomic save refresh bursts).

  • Kept recent-save suppression active for the full macOS/VS Code atomic watcher burst, including raw change/delete/create events.
  • Added a perf-report contract requiring exactly one correlated incrementalRefreshMs and watcherToGraphMs sample for single-save.
  • Split operation reduction into focused modules below the repo's 50-mutation-site limit.
  • Added an extension patch changeset.

Local visible-Graph-View verification (small, one full run, no CI dependency):

  • correlated refreshes per measured save: 3 → 1
  • watcherToGraphMs.save: 563.6 ms prior five-run median → 110.1 ms (80.5% lower)
  • incrementalRefreshMs.save: 74.6 ms
  • all scripted VS Code/Explorer scenarios exited 0 with the Graph View open

Quality evidence:

  • extension suite: 7,037/7,037
  • perf harness after the split: 144/144
  • mutation: recent saves 12/12, operations 34/34, watchers 32/32, operation model 39/39, batch reducer 22/22 — all 100%
  • repo-wide pre-commit acceptance ownership guard, typecheck, and staged lint passed

Next: adopt the clean small baseline, push the PR/dispatch workflow split and runner-class baseline separately, then finish the Phase 1 gate proof.

Reduce the per-PR matrix from seven configurations to small and medium while preserving all seven for manual dispatch. Replace the unbudgeted three-run lane with the runner-class 20% regression budget and seed small/medium Linux baselines.
@joesobo

joesobo commented Jul 11, 2026

Copy link
Copy Markdown
Owner Author

Explorer parity performance checkpoint

The provisional Phase 8 report is now committed at docs/perf/2026-explorer-parity-report.md (a1ed17f49). It includes every Phase 3/4 gate, retained samples, variance, and an Obsidian context table. No 30k fixture was generated or run; the cap remained 10k.

Accepted evidence includes the 383-byte diff payload (99.923% below baseline), zero layout resets across five medium + five large saves, deterministic one-refresh 100-file bursts, 43.01% faster large cold indexing, and 831-byte adjacent-revision patches.

Owner decision / further engineering is still required for:

  • 3-C optimistic rename: 50.954ms vs Explorer 3.265ms (15.61x)
  • 3-F idle CPU: 9.983% with zero simulation ticks (target <2%)
  • 3-J 10k render: 2.281 FPS; zero-simulation upper bound 22.552 FPS (target 30)
  • 4-B warm scope projection: 34/36 directions over 50ms in the complete medium battery
  • 5-B large group drag: median 4.564 FPS, CV 0.77%
  • 6-B real VS Code input focus ownership after inline collision

The renderer policy in the plan reserves PixiJS/WebGL migration for owner discussion. Phase 9 remains blocked until the report/showcase are complete and exceptions or follow-up work are explicitly accepted. The deferred drag-to-folder / external OS-drop follow-up is filed at https://trello.com/c/z907ZEa2/259-graph-file-drag-to-folder-external-os-drop.

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