Skip to content

REPL.5 — Batch-mode & cold-start spike: AppCDS lever SHIPPED (#163 fix 3) - #170

Draft
fupelaqu wants to merge 1 commit into
mainfrom
feature/REPL.5
Draft

REPL.5 — Batch-mode & cold-start spike: AppCDS lever SHIPPED (#163 fix 3)#170
fupelaqu wants to merge 1 commit into
mainfrom
feature/REPL.5

Conversation

@fupelaqu

@fupelaqu fupelaqu commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Story REPL.5 (epic REPL Hardening — LAST story, closes the epic's #163 chain)

Time-boxed spike: measurement matrix first, AppCDS lever second, explicit ship decision third. The spike ran GO (residual warm batch overhead ≈1.9s on the -all install ≥ the 1.5s trigger) and the lever measured above the ship bar, so it shipped.

Measurements (median of 5 + discarded prime, Zulu 17.0.11, docker ES 8.18.3 :19200 warm, es8 -all bundle rebuilt locally from softclient4es-repl feature/REPL.4)

Cell 278-jar baseline -all bundle bundle + AppCDS
prompt-and-exit 1.428s 1.305s 0.926s
-c SELECT LIMIT 5 2.054s 1.924s 1.525s (−399ms / −20.7%)
-c single JOIN 3.316s 3.187s 2.729s
-f 10-statement batch 2.136s 2.020s 1.642s (marginal ≈9–12ms/stmt)

JDK 21 (AutoCreateSharedArchive): SELECT 1.784s → 1.313s (−26%). JDK 11: no CDS flags, byte-identical exec java line (trace-proven). Full matrix + environment + deviations in the story spec's Dev Agent Record.

What shipped (install.sh + docs only, zero Scala)

  • Launcher CDS block between EXTRA_OPTS and LOGBACK_OPTS, bundle-gated via the install-time baked CDS_BUNDLE=${USE_BUNDLE:-false} (the one deliberately unescaped $ in the heredoc). Plain/--no-extensions installs are byte-identical in behaviour on every JDK incl. 19+ (verified: no flags, no cache/).
  • generate_cds_archive() — install-time dynamic archive for JDK 13-18 (bare-jar -cp, -c "help" workload, needs no ES, 1.9s), set -e-hardened, success requires the .jsa to exist (an unwritable path still exits 0); JDK 19+ self-serves at runtime. Failure = warn-and-continue (verified with an unwritable cache/).
  • AppCDS: line in installer summary + VERSION.
  • Docs: Cold-start & batch invocation cost in documentation/client/repl.md-f/;-split batching is the recommended scripted shape (PD-2).

Empirical checkpoints (spec OQ-2/OQ-3, all resolved)

  • C1 archive rich: 53MB, 6892 classes served from the archive at runtime.
  • C2 runtime [jar, jar] (bundle jar duplicated via lib/*) validates against dump-time [jar].
  • C3 (undetermined from official docs — settled here): JDK 21 AutoCreateSharedArchive creates and maps the archive despite the literal lib/* wildcard in -cp — the java launcher expands * before the VM sees it. The -cp "$JAR_FILE" fallback was never needed; REPL.4's duplicate-classpath guidance (its Task 2.6) stands unmodified.

Coordination (IMPORTANT — merge order)

Merge sequence: REPL.2 (#165) → REPL.4 (#167) → this PR LAST. The launcher block reads REPL.4's USE_BUNDLE (Task 2.2); until REPL.4 merges, ${USE_BUNDLE:-false} keeps everything inert (verified on this branch, which is off main). Expected trivial build.sbt version-line conflict with #164/#165/#166/#167 (all bump 0.20.1 → 0.20.2-SNAPSHOT). After each rebase: bash -n install.sh + a scratch install.

Incidental finding (pre-existing, NOT fixed here — candidate follow-up issue)

The published 0.20.1 plain cli assembly fails every query on JDK 21: InetAddressResolverProvider: DnsjavaInetAddressResolverProvider not found (services-merge keeps dnsjava's registration, class absent; JDK 18+ consults the SPI). Reproduced without this branch's changes; the -all bundle is unaffected. Should ride 0.20.2 together with #168.

Deferred (recorded): PD-5 softclient4es-web mirror — the site has no REPL page (same deferral as REPL.4).

Closes #163 · Refs #169 (epic)

🤖 Generated with Claude Code

Refs #171 — the JDK 18+/21 plain-cli resolver-SPI failure described above, now filed (with #172, both riding 0.20.2 alongside #168).

…tch amortization docs (REPL.5 spike)

Time-boxed spike #163 fix 3 — measured first, shipped what measured well:
- launcher CDS block, bundle-gated via install-time baked CDS_BUNDLE
  (${USE_BUNDLE:-false} — inert until REPL.4 merges; plain/--no-extensions
  installs stay byte-identical on every JDK incl. 19+)
- generate_cds_archive(): install-time dynamic archive (JDK 13-18, bare-jar
  -cp, -c "help" workload, no ES needed), set -e-hardened, success requires
  the .jsa to exist; JDK 19+ self-serves via -XX:+AutoCreateSharedArchive
  (verified: runtime dump works despite the literal lib/* wildcard)
- AppCDS status line in installer summary + VERSION
- docs: Cold-start & batch invocation cost (-f/;-split amortization ≈9-12ms
  marginal per statement; AppCDS automatic on bundle installs, JDK 13+)

Measured (median of 5, Zulu 17.0.11, es8 -all bundle, warm ES 8.18.3):
-c SELECT 1.924s -> 1.525s (-20.7%), prompt-and-exit 1.305s -> 0.926s,
JOIN 3.187s -> 2.729s; JDK 21: 1.784s -> 1.313s. JDK 11: no flags, identical.

Version bumped to 0.20.2-SNAPSHOT (shared REPL.x line — expect trivial
build.sbt conflict with sibling REPL PRs). Merge order: REPL.2 -> REPL.4 ->
REPL.5 (this lands LAST).

Closed Issue #163
Refs #169

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

REPL: first cross-index JOIN takes ~2.4s (up to 10s cold) vs ~100ms for subsequent ones — one-time init lands in the user's first query

1 participant