Skip to content

[anneal] Add playground Rust server - #3540

Open
platonicsock wants to merge 1 commit into
Gklylrwoplohejnfq3oo4uymvshcq3o62from
Gzpgd7p6so5xn3tfstq45vnmycc7weotp
Open

[anneal] Add playground Rust server#3540
platonicsock wants to merge 1 commit into
Gklylrwoplohejnfq3oo4uymvshcq3o62from
Gzpgd7p6so5xn3tfstq45vnmycc7weotp

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/Gzpgd7p6so5xn3tfstq45vnmycc7weotp && git checkout -b pr-Gzpgd7p6so5xn3tfstq45vnmycc7weotp FETCH_HEAD

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gzpgd7p6so5xn3tfstq45vnmycc7weotp

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 (bdaf71d) to head (7250609).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           Gklylrwoplohejnfq3oo4uymvshcq3o62    #3540   +/-   ##
==================================================================
  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 Gzpgd7p6so5xn3tfstq45vnmycc7weotp branch from 0bfeaf4 to f10d929 Compare August 11, 2026 15:36
@platonicsock
platonicsock force-pushed the Gklylrwoplohejnfq3oo4uymvshcq3o62 branch from 8031649 to 0a09e52 Compare August 11, 2026 15:36
gherrit-pr-id: Gzpgd7p6so5xn3tfstq45vnmycc7weotp
@platonicsock
platonicsock force-pushed the Gzpgd7p6so5xn3tfstq45vnmycc7weotp branch from f10d929 to 7250609 Compare August 11, 2026 15:42
@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: 7250609b11

ℹ️ 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".

Comment on lines +505 to +507
GarbageCollection => {
active_executions
.retain(|_id, (_, tx)| tx.as_ref().is_some_and(|tx| !tx.is_closed()));

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 Keep closed-stdin executions alive during GC

When a client sends wsExecuteStdinClose, the entry's stdin sender is set to None to close stdin; on the next 30-second GC pass this predicate removes every None entry. Removing the entry drops the stored DropGuard, which cancels the execution token, so any websocket run or Anneal verification that closes stdin but continues for more than 30 seconds is aborted despite the much longer session timeout. Keep closed-stdin executions in the map until their task actually finishes, or track completion separately.

Useful? React with 👍 / 👎.

Comment on lines +761 to +762
fn record_websocket_error(error: String) {
*WS_ERRORS.lock().unwrap_or_else(|e| e.into_inner()).entry(error).or_default() += 1;

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 Bound stored WebSocket error keys

The public /nowebsocket endpoint records the client-provided error string as a permanent key in this global map, so repeated requests with unique or large error values grow memory for the lifetime of the server. In a public deployment, a client can use this unauthenticated endpoint to cause unbounded memory growth; truncate and cap the stored keys, or aggregate unknown errors instead.

Useful? React with 👍 / 👎.

pub(crate) tests: bool,
#[serde(default)]
pub(crate) backtrace: bool,
pub(crate) code: String,

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 Accept multi-file HTTP code payloads

The Rust Playground HTTP API also accepts code as an array of {name, content} files, but this server models it as a plain String. Any existing client or frontend path that submits multi-file snippets to /compile or /execute will now fail JSON deserialization before reaching the orchestrator; keep the untagged single-or-multiple code type and lower each file into the sandbox instead of only accepting one string.

Useful? React with 👍 / 👎.

cargo_anneal_verify_ms_found = cargo_anneal_verify_ms.is_some(),
"[anneal-prewarm] stable Anneal prewarm finished"
);
*self.coordinator.lock().await = Some(coordinator);

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 Release prewarm container when limits are tight

When PLAYGROUND_ANNEAL_PREWARM_STABLE is enabled, this stores a live coordinator that keeps its Docker container permit indefinitely until a WebSocket happens to consume it. With the intended small deployment settings such as PLAYGROUND_COORDINATORS_LIMIT=1, that cached prewarm occupies the only container slot and does not listen for container_requested, so HTTP requests and metadata cache refreshes can time out or hang waiting for a permit. Idle or drop the prewarm when another request needs capacity.

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