Skip to content

Optimize Swift and TypeScript CodeMap pipelines#608

Merged
baron merged 11 commits into
mainfrom
perf/swift-pipeline-deep-optimization
Jul 23, 2026
Merged

Optimize Swift and TypeScript CodeMap pipelines#608
baron merged 11 commits into
mainfrom
perf/swift-pipeline-deep-optimization

Conversation

@provencher

Copy link
Copy Markdown
Collaborator

Summary

  • add deterministic Swift and TypeScript/TSX file-to-CodeMap benchmark/reference coverage with exact query, capture, and artifact parity checks
  • optimize Swift signature whitespace normalization, parameter type scanning, property type extraction, and repeated referenced-type inputs
  • generalize the proven signature-normalization primitive to JavaScript/TypeScript/TSX with an ASCII no-op/rewrite path and exact Unicode fallback
  • remove obsolete model-benchmark/PromptFactory and Neon syntax-highlighting infrastructure while preserving live app diagnostics, CodeMap parsing, Markdown highlighting, and the active SystemPromptService boundary

Performance

Swift deterministic 64-file corpus

Stage Baseline Retained Delta
Full source-to-CodeMap 107.107 ms 97.4485 ms -9.02%

Retained iterations:

  • signature whitespace normalization: 107.107 → 104.660 ms (-2.29%)
  • parameter type scanning: 104.660 → 101.2865 ms (-3.22%)
  • property type extraction: 101.2865 → 98.874 ms (-2.38%)
  • referenced-type input deduplication: 98.874 → 97.4485 ms (-1.44%)

TypeScript / TSX synthetic pipeline

Shape Language Baseline Retained Delta
Full file-to-CodeMap TS 129.3660 ms 126.7585 ms -2.02%
Full file-to-CodeMap TSX 244.8285 ms 240.6505 ms -1.71%
Pre-materialized generator TS 66.4170 ms 63.5775 ms -4.28%
Pre-materialized generator TSX 121.9060 ms 116.0640 ms -4.79%

The shared JSTS normalization leaf improved 15.5–19.7%. Exact TS/TSX captures and artifacts remained unchanged.

Rejected experiments

  • removing a legacy Swift type capture regressed the pipeline and was reverted
  • a Swift TypeCleaner ASCII no-op gate measured only 0.10% under stable counterbalanced A/B and was reverted
  • TS/TSX raw referenced-type dedup skipped hundreds of cleaner calls but regressed all wall-clock metrics by 6.5–8.9% and was fully reverted

Validation

  • PR-ready contribution preflight passed, including outgoing-range secret scan, guardrails, conductor self-tests, strict lint, full root test suite, RepoPrompt product build, and generated Xcode workspace validation
  • CodeMapQueryOptimizationBenchmarkTests: 25 passed, 1 expected skip
  • exact TS/TSX references: 2,000 / 2,400 captures
  • exact Swift reference: 64 files / 4,381 captures
  • CodeMap goldens: 4 passed
  • syntax artifact tests: 6 passed
  • authoritative root test inventory: 3,486 methods
  • both RepoPrompt and repoprompt-mcp product builds passed; debug app packaged and relaunched

Live full-workspace measurement

The DEBUG codemap_full_load harness was armed against the freshly relaunched app and the repoprompt-ce workspace. The workspace switch remained pending and did not reach authoritative CodeMap proof readiness within the raised 600-second diagnostic window. This PR therefore claims only the repeatable corpus improvements above; the remaining full-workspace load bottleneck is not represented as solved.

Known unrelated inventory issue

The existing curated ledger verifier reports five missing IDs and zero stale IDs. This PR keeps that known discrepancy unchanged; all tests added or removed here have surgical ledger entries.

@baron baron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full 4f6003b…2db7459d diff, including the Swift/JavaScript/TypeScript fast paths, referenced-type deduplication, instrumentation, build/guardrail changes, and legacy benchmark/prompt/highlighting removals. The removed preview-highlighting path was dead at the base with no consumer/render path. Fab independently reviewed the change and found no blocking defects. The lone CI failure was the known unrelated #161 flake; its rerun passed. Approved.

@baron
baron merged commit af1cb58 into main Jul 23, 2026
18 of 19 checks passed
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.

2 participants