Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/capture-lab.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ Both global and instance Java selections use the copied Prism runtime.
External Java paths, including system runtimes, require a separate sandbox contract and are rejected by isolated replay.
Escaping source links and write-through links in profile configuration cause preparation to stop.

Private preparation resolves ancestor aliases such as macOS `/var` to `/private/var` before checking ownership and copying data.
The owned directory itself must still be a real directory, and writable configuration files cannot be symlinks.
Native installation copies use the filesystem copy API with a full-copy fallback when cloning is unavailable.
On macOS, native idle checks require Python 3 and inspect exact environment entries through Darwin's process API.
They recognize path aliases, ignore command-line lookalikes, and never print process environments.
Unavailable inspection stops preparation; the replay launcher's virtual display and network namespace requirements still apply.

Java cleanup records process IDs and start times, including launcher descendants.
It verifies these identities immediately before each signal.
A reused or unrecorded process ID stops cleanup without signaling that process.
Expand Down
1,598 changes: 1,453 additions & 145 deletions patches/viabedrock/upstreamable/0001-cache-converted-resource-packs.patch

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Please check that a changed source pack cannot reuse an older conversion, and that reconnecting with unchanged packs avoids another conversion.

## Download completion on bounded workers

Receiving the last pack chunk no longer hashes and inflates the entire archive on the connection event loop. Chunk assembly stays on that loop, with a constant-time remaining count; completed archives use the existing bounded preparation workers. Duplicate chunks cannot alter a completed buffer or enqueue another decode. ZIP input streams release their native inflater after success or failure.

Decoded packs remain associated with their exact download entry until publication on the event loop. Channel, load tracker, download tracker, and entry identity checks reject obsolete results. Decode failures, worker rejection, and shutdown settle negotiation and use the existing disconnect handling. The synchronous decoder API remains available for integrations.

The standalone owning patch passes 45 tests and both Checkstyle tasks. New regressions cover out-of-order chunks, failed-copy accounting, digest and archive errors, event-loop responsiveness, stale owners, rejection, shutdown, and failed negotiation completion. The complete core build passes 1,155 tests with 30 optional skips and no failures or errors. These are correctness and responsiveness checks; no new live-server frame-time or joining benchmark was performed.

## Testing

- [x] Run `./gradlew test checkstyleMain checkstyleTest` on the feature-only checkout.
Expand Down Expand Up @@ -228,3 +236,13 @@ The cache schema still restores finite scales as floats.
The feature-only tests and both Checkstyle tasks pass.
The cache patch applies alone to the pinned upstream base and passes all 22 tests and both Checkstyle tasks.
The complete core and add-on builds also pass after replaying the stacks.

## Bound retention and keep preparation off connection threads

Completed conversions now use a 32-entry LRU with a 128 MiB retention budget for archive bytes and estimated metadata. In-flight sharing is separate, so oversized results can serve waiting connections without remaining cached. Verified disk entries can reload after eviction.

Source ZIP loading, decryption, persistence, and definition construction run on bounded workers. Conversion has two workers and 64 queued tasks; HTTP-server preparation has two workers and 32 queued tasks. Hosts with fewer processors use fewer workers. Translation-disabled connections lazily own one preparation worker with one queued task. Saturation fails through the existing connection error path without running heavy work on the caller. Shutdown completes pending futures.

Preserve all downloaded INFO packs before selecting STACK resources, including unused offers. Publish storage and advertise resources only while the owning tracker, storage, and channel remain current. Selected subpacks, builtin layers, and conversion-profile fingerprints survive full-stack replay.

Validation: the standalone owning patch passes 34 tests and both Checkstyle tasks. The complete core build passes with 1,144 tests passed and 30 skipped; the add-on and ViaProxy also build against the updated library. Regressions cover eviction, oversized sharing, queue rejection, shutdown, nonfatal source-cache failures, stale publication, and event-loop responsiveness. No new live joining-time or frame-time measurements were made.
Loading