Repository navigation
perf(stack): reduce resource, chunk and actor stalls - #9
milesalexg-tech wants to merge 4 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bound completed conversions and background resource preparation, preserve source caching, and guard lifecycle publication on connection event loops. Skip irrelevant connected-block scans and coalesce queued chunk ticks. Reuse immutable actor render snapshots and index effect locators once. Fold improvements into their owning upstreamable patches and replay later features with subpacks, builtin resources, doors and dimension guards intact. Document focused regressions and complete build validation in review notes.
Resolve ancestor aliases before comparing owned paths, while rejecting symlink roots and writable files and preserving exclusive creation, ownership rechecks, source boundaries, and scoped fixture rollback. Bind fixture previews and copied Java selections to their canonical paths. Replace the GNU cp invocation with the filesystem copy API, preserving timestamps and symlink bytes with a full-copy fallback. Share native environment ownership inspection between launcher profiles and Wine prefixes. On Darwin, use bounded KERN_PROCARGS2 reads through Python 3 instead of /proc or ambiguous ps output. Compare complete environment values across path aliases, including destinations not created yet, and fail closed if process inspection is unavailable without printing data. Cover ancestor aliases, symlink refusals, source preservation, active child processes, misleading arguments and variable names, and unavailable inspection. All 18 baseline macOS failures are resolved; bun test passes with 204 tests and four skips, and bun run check passes.
KERN_PROCARGS2 can return EIO when a process exits or changes its stack after enumeration. The old helper treated that ordinary lifetime race as an inspection failure, intermittently blocking safe prefix preparation. Retry only stack-copy/parse races, at most three times with bounded waits. Check PROC_PIDT_SHORTBSDINFO before discarding an exited or zombie entry, and retain fail-closed behavior for persistent failures in a live process or unavailable lifetime inspection. Keep exact NUL-delimited environment matching and never publish process arguments or environments. Add deterministic retry, lifetime, malformed-buffer, persistent-failure, and native ABI tests, plus real rapid process-exit regression coverage. Validate 1,000 live scans during process churn and ten repeated focused native preparation suites without failures. Full bun test and typecheck also pass.
Fold bounded completed-download decoding and constant-time chunk receipt into the resource cache owner. Preserve event-loop publication, session identity guards, exceptional negotiation completion, synchronous integration APIs, and ZIP inflater cleanup. Keep selected subpacks and archive path normalization in their existing owners. Full core, addon and proxy builds pass; the standalone owner passes 45 tests and Checkstyle. Clean replay reproduces the tested complete source tree.
Adapt the reviewed resource, chunk and actor optimizations from PR #9 onto the current stacks. Keep download verification and resource preparation off connection event loops, bound worker queues and complete pending work on shutdown. Reuse palette classifications, resolved actor draws and effect locator indexes instead of repeating work for unchanged inputs. Preserve the four-entry, 64 MiB conversion cache, weak actor ownership, weak chunk reservations, sound sharing and repeated cursor crafting fixes. Fold each feature into its existing owning patch and replay later features. Leave the macOS tooling changes for separate integration because they overlap existing workspace edits. The full dependency build passes with 1,967 tests passed and 150 skipped. The standalone cache patch passes 45 tests and both Checkstyle tasks. TypeScript and patch whitespace checks pass. Live frame-time gains remain unmeasured. Co-authored-by: Miles Tech Studios <291174896+milesalexg-tech@users.noreply.github.com>
|
Manually integrated the reviewed resource, chunk and actor optimizations into main in eb94fe6. The commit and owning feature patches credit @milesalexg-tech as co-author. Included:
Preserved the current four-entry/64 MiB conversion cache limits, weak chunk reservations, weak actor ownership, sound sharing and cursor crafting fixes. Each change stays folded into its existing owning patch. The macOS profile/process changes remain separate because they overlap existing workspace edits. This is a partial integration, so the PR remains open. Validation: all four dependency builds pass, with 1,967 tests passed and 150 skipped. The standalone cache patch replays on pinned upstream and passes 45 tests plus both Checkstyle tasks. TypeScript and patch whitespace checks pass. No new live frame-time measurements were made. |
Resource-pack preparation could block connection threads, completed conversions accumulated without a retention limit, and chunk/actor work repeated while its inputs were unchanged. This change bounds background work and caches, skips irrelevant chunk cells, and reuses stable render data.
Changes
The changes are folded into their owning upstreamable patches. Later patches are replayed with selected subpacks, builtin resource layers, custom conversion profiles, doors, and replaced-dimension checks preserved. Each owning patch includes updated review and testing context.
Validation
bun run pr check viabedrockapplies the first upstreamable patch to the pinned upstream base without setup/deferred patches. That standalone checkout passes all 45 tests and both Checkstyle tasks.bun run checkandgit diff --checkpass. Full Bun suite on macOS: 206 passed, 4 skipped, zero failures. Six Python process-inspection regressions pass. The platform changes resolve the 18 original macOS failures; repeated process-churn checks exercise transient Darwin stack-copy races.No new live-server frame-time, FPS, or joining-time measurements were made. Completed-download inflation now runs off the event loop; client resource reloads and other workloads still need live profiling. These changes do not claim to eliminate every possible lag spike.