fix(agent): prefetch Rust from current Longshot trees #185
No reviewers
Labels
No labels
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Beanstalk!185
Loading…
Reference in a new issue
No description provided.
Delete branch "futondestroyer/Beanstalk-contributions:fix/rust-prefetch-184"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes Beanstalk #184. Worker prefetch selects the Rust bootstrap from pinned Longshot main. It uses
rust_toolchain.pyandtools.lockon current trees and supports legacyrenhdrum.py, including older trees with aSTDmapping. The worker verifies and stages shaderc in the Builder's Rust cache and makes the pinned Windows zstd available read-only inside AppContainer. The Builder uses the prefetched crate archives offline.This restores the prefetch path needed by Longshot #1184 and Longshot #1539 once a compatible signed worker is available.
Testing
e25641a01cc2059bbea6de9e425d1e441ea3b395on Windows 11 with .NET SDK 10.0.401. Agent Core compiled with zero warnings and zero errors. All 20 focused prefetch checks passed.50e52e47173abb67ef2634b2244fd8523a3a33a2,73f12f0e8dfe46a7b64219c21c4872694d2bae06,8c058ddbb91b4eacc261682bb931bcb69ef4a6f6and3a0f7d8f7f34360a464df614fc38a2a0c5bf6806. It exercised both target selections with synthetic verified caches and networking disabled. The existing worker passed 2/8 and the fix passed 8/8.e25641a0with Longshot8c058ddb, real Windows worker prefetch verified Rust 1.99.1, 717 crate archives and pinned shaderc. The normal AppContainer work drive then built the Builder withcargo build --profile release --locked --offlinein 11m22s and exited 0. The Builder was 395,618,816 bytes with SHA-256f45df4d6ff9416a9c083d4c02f394cf9d4477b3f5f43b116967b35559b0e4b72. Windows acceptance receiptSetupCheckssynthetic Python symlink fixture withA required privilege is not held by the clienton official baseadde94bc90ad5cf0e2283954dda8de233480ac3aand the first candidatedbe4938d2eab6c8e03fc1af909f2b2d31f139613. The exact-head focused checks and the real Windows worker test above completed. All tests were game-free.Still to test
ubuntu-latestrunner.e25641a01cc2059bbea6de9e425d1e441ea3b395and Longshot8c058ddbb91b4eacc261682bb931bcb69ef4a6f6. Record the worker revision, both source pins, verified prefetch, bubblewrap mode and Builder result. Exact-head BeanBot reviewRisks
The versioned Builder cache key causes one initial rebuild even if the selected Rust pins are identical. Jobs still use the trusted checkout, digest checks and existing sandbox rules.
@review
Recommendation: Approve. The commit records AI assistance but omits a required co-author trailer. The selector passed focused checks, but an end-to-end offline builder run has not yet shown the fix working on either supported platform. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The worker selects the Rust bootstrap used by the pinned Longshot tree and includes the current helper and tools.lock in the builder cache key. Existing cache entries will rebuild once.
Should fix (1): not blocking, but worth doing before merging.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
agent/Core/WorkspaceBuilder.cs:177: The Windows evidence stops before the worker's offline builder consumes the prefetched cache. (more on the line) Do: Run a game-free Windows worker prefetch followed by the offline sandboxed builder build for the intended pinned tree, recording worker version and commits.agent/Core/WorkspaceBuilder.cs:177: The changed worker path has no reported native Linux run. (more on the line) Do: Run a game-free native Linux worker prefetch and offline sandboxed builder build for the intended pinned tree, recording worker version and commits.@fixcan do L1.Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven end to end. The reported Windows snippet passed 8 of 8 synthetic-cache cases against four Longshot trees, versus 2 of 8 for the old snippet, but neither a complete worker prefetch nor an offline sandboxed builder run was reported.
Other systems: The change affects Windows and Linux workers, current and legacy Longshot trees, builder caching, and offline crate consumption. The focused Windows checks cover target selection and checksum rejection; native Linux and the sandboxed build path still need runs.
Switches: None.
Reviewed:
dbe4938d2eagainstadde94bc90: Read the repository rules, commit, complete diff, changed sections and their prefetch, cache-key, tool-comparison, test-driver and job-pipeline callers. Skimmed the remaining portions of the four changed files; they were not all read in full. No review checklist or pull request template was present.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code or tests were run. The reported Windows focused checks passed, and the Forgejo checks were still running.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -171,2 +175,3 @@+ "scripts = os.path.join(os.getcwd(), 'scripts'); sys.path.insert(0, scripts)\n"+ "cache, target, lock = sys.argv[1:4]\n"+ "rust_bin = renhdrum.toolchain(cache, longshot_builder.STD[target])\n"+ "if os.path.isfile(os.path.join(scripts, 'rust_toolchain.py')):\n"L3 (should fix): The Windows evidence stops before the worker's offline builder consumes the prefetched cache.
When: The reported focused run checks synthetic cache inputs; it does not show that a Windows worker can prefetch the intended tree and build its builder in the sandbox without network access.
Do: Run a game-free Windows worker prefetch followed by the offline sandboxed builder build for the intended pinned tree, recording worker version and commits.
L4 (should fix): The changed worker path has no reported native Linux run.
When: Both the bootstrap selection and the offline sandboxed builder path run on Linux, but the reported focused checks ran on Windows.
Do: Run a game-free native Linux worker prefetch and offline sandboxed builder build for the intended pinned tree, recording worker version and commits.
dbe4938d2e8ca4a8392c@review
8ca4a8392c— attribution-only amendment for L1. The tested source tree is unchanged.Recommendation: Approve. The code is ready: only testing is left. The attribution requirement is satisfied, and the reported focused checks support the prefetch fix. An integrated offline builder run on Windows and a native Linux run remain outstanding. Recommend approval; not approved on the forge.
The worker selects the current or legacy Rust bootstrap and includes current toolchain inputs in the builder cache key, allowing prefetch for newer Longshot trees. Existing builder cache entries incur an initial rebuild.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
agent/Core/WorkspaceBuilder.cs:177: The Windows evidence stops before the worker's offline builder consumes the prefetched cache. When: The reported focused run checks synthetic cache inputs; it does not show that a Windows worker can prefetch the intended tree and build its builder in the sandbox without network access. Do: Run a game-free Windows worker prefetch followed by the offline sandboxed builder build for the intended pinned tree, recording worker version and commits.agent/Core/WorkspaceBuilder.cs:177: The changed worker path has no reported native Linux run. When: Both the bootstrap selection and the offline sandboxed builder path run on Linux, but the reported focused checks ran on Windows. Do: Run a game-free native Linux worker prefetch and offline sandboxed builder build for the intended pinned tree, recording worker version and commits.Since the last review (on
dbe4938d2e)Resolved: L1 (The AI-assisted commit lacks the required Co-Authored-By trailer.)
Still open: L3 (The Windows evidence stops before the worker's offline builder consumes the prefetched cac…); L4 (The changed worker path has no reported native Linux run.)
Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven: the reported focused comparison passed 8 of 8 candidate runs versus 2 of 8 before, but the offline builder has not yet been shown consuming the prefetched cache.
Other systems: The path affects Windows and Linux workers and their sandboxed offline builds. The reported Windows checks used synthetic caches; no native Linux run or integrated offline builder run is reported.
Switches: None.
Reviewed:
8ca4a8392cagainstadde94bc90: Read AGENTS.md, CONTRIBUTING.md, the commit message and the full diff. The changed code files were inspected, but the combined output was truncated, so portions of the large files were not read.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run tests were executed. The reported focused Windows checks passed; full Agent Core CI is still running.
Overlaps and merge order: Longshot #1184 and #1539 are identified as jobs this unblocks; no overlapping Beanstalk pull request was identified.
Automated code review by BeanBot (gpt-6.1-terra), asked for by futondestroyer. Nothing was run; a maintainer decides.
@review
e25641a01cc2059bbea6de9e425d1e441ea3b395The previous head passed real Windows Rust prefetch but the AppContainer Builder could not find zstd. This follow-up exposes the worker's pinned zstd read-only and stages the exact shaderc archive and unpack stamp in the Builder's cache from the trusted base, outside the sandbox. Older Builder trees without a separate shaderc cache still work.
All 20 focused Windows checks passed. On Longshot Farm base
8c058ddbb91b4eacc261682bb931bcb69ef4a6f6, the real worker verified Rust 1.99.1, all 717 crate archives and the pinned shaderc archive. Its AppContainer reachedcargo build --locked --offline. With the supported no-work-drive setting on this PC, LLVM-MinGW returnedPermission deniedwhile linking host build scripts. The normal work drive in shallow isolated staging passed the sandboxed clang/LLD compile-and-link probe, and that worker's offline Builder is running. Windows L3 and native Linux bubblewrap L4 remain open. Hold the Farm retries until a compatible signed worker is installed and the game-free Builder path passes.Recommendation: Approve. The code is ready: only testing is left. The Windows worker reached an offline Cargo build using the prefetched cache, but the changed path still needs a native Linux run. Recommend approval; not approved on the forge.
The worker selects the Rust bootstrap used by current Longshot trees while retaining legacy support, and stages shaderc and zstd for the offline Builder. This adds prefetch work and invalidates existing Builder cache keys.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
agent/Core/WorkspaceBuilder.cs:177: The changed worker path has no reported native Linux run. When: Both the bootstrap selection and the offline sandboxed builder path run on Linux, but the reported focused checks ran on Windows. Do: Run a game-free native Linux worker prefetch and offline sandboxed builder build for the intended pinned tree, recording worker version and commits.Since the last review (on
8ca4a8392c)Resolved: L3 (The Windows evidence stops before the worker's offline builder consumes the prefetched cac…)
Still open: L4 (The changed worker path has no reported native Linux run.)
Checks: Still running: 5 checks.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes for Windows prefetch: the reported worker verified Rust 1.99.1 and 717 crate archives, then reached cargo build --locked --offline. The full Builder did not finish in the reported no-work-drive run.
Other systems: The change affects Windows AppContainer and Linux bubblewrap builds. Windows reached offline compilation; native Linux remains untested. The reported no-work-drive Windows run failed while linking host build scripts.
Switches: None.
Reviewed:
e25641a01cagainstadde94bc90: Read the repository rules, commit log, full diff and changed code as available; inspected the sandbox environment and cache callers. The long changed files and tests were skimmed in parts because command output was truncated. No review checklist or pull request template was found.; nothing run (a code review).Checked and fine:
Testing: Not run by this review. The author reports 20 focused Windows checks passing; full Agent Core CI is still running.
Overlaps and merge order: None found.
Automated code review by BeanBot (gpt-6.1-terra), asked for by futondestroyer. Nothing was run; a maintainer decides.
Windows L3 passed end to end at Beanstalk
e25641a01cc2059bbea6de9e425d1e441ea3b395with Longshot8c058ddbb91b4eacc261682bb931bcb69ef4a6f6.cargo build --locked --offlinecompleted in 11m 22s. The worker retained the Builder and returned success.longshot-builder --versionreturned0.1.0 (a developer's build: no sources carried). Builder SHA-256f45df4d6ff9416a9c083d4c02f394cf9d4477b3f5f43b116967b35559b0e4b72matched the build output. The pinned Longshot tree warned that the Colour vision and CRT system mods were omitted from its trusted table because glslang was unavailable. This was a game-free Builder acceptance and did not exercise those effects.Native Linux L4 still needs the same prefetch and offline Builder run with real bubblewrap. Release and Farm retries remain gated on that test and a compatible signed worker.
WIP: fix(agent): prefetch Rust from current Longshot treesto fix(agent): prefetch Rust from current Longshot trees