Skip to content

[anneal] Add playground compiler backend - #3539

Open
platonicsock wants to merge 1 commit into
G65mwqxbdjmwi2jj4gocgwsitq76ek3dhfrom
Gklylrwoplohejnfq3oo4uymvshcq3o62
Open

[anneal] Add playground compiler backend#3539
platonicsock wants to merge 1 commit into
G65mwqxbdjmwi2jj4gocgwsitq76ek3dhfrom
Gklylrwoplohejnfq3oo4uymvshcq3o62

Conversation

@platonicsock

@platonicsock platonicsock commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Latest Update: v12 — Compare vs v11

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v8 v7 v6 v5 v4 v3 v2 v1 Base
v7 v6 v5 v4 v3 v2 v1 Base
v6 v5 v4 v3 v2 v1 Base
v5 v4 v3 v2 v1 Base
v4 v3 v2 v1 Base
v3 v2 v1 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Gklylrwoplohejnfq3oo4uymvshcq3o62 && git checkout -b pr-Gklylrwoplohejnfq3oo4uymvshcq3o62 FETCH_HEAD

Checkout

git fetch origin refs/heads/Gklylrwoplohejnfq3oo4uymvshcq3o62 && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Gklylrwoplohejnfq3oo4uymvshcq3o62 && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Gklylrwoplohejnfq3oo4uymvshcq3o62

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@codecov-commenter

codecov-commenter commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (2ad3fe6) to head (bdaf71d).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           G65mwqxbdjmwi2jj4gocgwsitq76ek3dh    #3539   +/-   ##
==================================================================
  Coverage                              91.85%   91.85%           
==================================================================
  Files                                     20       20           
  Lines                                   6093     6093           
==================================================================
  Hits                                    5597     5597           
  Misses                                   496      496           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@platonicsock
platonicsock force-pushed the Gklylrwoplohejnfq3oo4uymvshcq3o62 branch from 8031649 to 0a09e52 Compare August 11, 2026 15:36
gherrit-pr-id: Gklylrwoplohejnfq3oo4uymvshcq3o62
@platonicsock
platonicsock force-pushed the Gklylrwoplohejnfq3oo4uymvshcq3o62 branch from 0a09e52 to bdaf71d Compare August 11, 2026 15:42
@platonicsock

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdaf71dcee

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

};

let prepare_start = time::Instant::now();
let (d, w, m) = try_join!(delete_files, write_files, modify_cargo_toml)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Serialize source preparation per container

When two requests use the same Container concurrently (for example, one prewarmed stable coordinator serving multiple WebSocket requests), both do_request instances rewrite the same project files before spawn_cargo_task acquires any process permit. The later request can overwrite src/main.rs, Cargo.toml, or anneal-workspace/src/main.rs after the earlier request has prepared them but before cargo reads them, so the earlier response can compile or verify another user's code; guard the whole prepare/spawn/read sequence with a per-container lock or isolate each job in its own directory.

Useful? React with 👍 / 👎.

Comment on lines +507 to +509
job_id = stdin_shutdown_rx.recv() => {
let job_id = job_id.context(StdinShutdownReceiverEndedSnafu)?;
state.stdin_close(job_id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Drop completed jobs' kill tokens

Every process inserts a DropGuard into kill_tokens when it starts, but on the normal completion path the shutdown notification only removes the stdin sender. In a long-lived worker container that handles many successful executions, kill_tokens therefore grows without bound (one token per job) until the worker exits; remove the token when processing the job-completion/shutdown notification as well.

Useful? React with 👍 / 👎.


let process_id = process_id.try_into().context(ProcessIdOutOfRangeSnafu { process_id })?;

let process = Process::new(process_id).context(InvalidProcessSnafu { process_id })?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep process statistics best-effort

When a command exits before the blocking statistics task opens its /proc entry, Process::new returns InvalidProcess, and process_end later turns that statistics-task error into a failed worker operation instead of returning the child’s real exit status. This can make short successful commands, such as version probes or cache-hit builds under load, surface as backend errors; treat missing stats for an already-exited child as no statistics rather than failing the command.

Useful? React with 👍 / 👎.

fn delete_files(&self) -> impl Iterator<Item = DeleteFileRequest> {
let files = match self.execution_tool {
ExecutionTool::AnnealVerify => vec![],
ExecutionTool::Cargo => vec![delete_previous_primary_file_request(self.crate_type)],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reset the workspace between executed programs

For Cargo execution requests this only removes the alternate src file and rewrites the primary source, but the program that cargo run executes has /playground as its writable cwd. A previous user can leave files such as build.rs or .cargo/config.toml behind, and Cargo will auto-detect and run/apply them on later users' builds in the same long-lived container; clean the package directory or run each request in an isolated workspace before accepting another request.

Useful? React with 👍 / 👎.

# https://stackoverflow.com/a/7577209/155423
cargo "build" "--target=wasm32-unknown-unknown" ${args[@]+"${args[@]}"}

for wasm in $(find target/ -name '*wasm' -not -path '*/deps/*'); do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Select the current wasm artifact explicitly

This scans every non-deps .wasm under the shared target/ tree and converts each one, so a long-lived container can return stale output from an earlier wasm compile (for example, a prior debug artifact when the current request is release, or a prior cdylib when the current crate type produces no wasm). Restrict the path to the artifact Cargo just built, or clear/fail when there is not exactly one current output, before copying to compilation.

Useful? React with 👍 / 👎.

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