Skip to content

Add Rust Anneal playground - #3510

Open
platonicsock wants to merge 1 commit into
google:mainfrom
platonicsock:add-rust-anneal-playground
Open

Add Rust Anneal playground#3510
platonicsock wants to merge 1 commit into
google:mainfrom
platonicsock:add-rust-anneal-playground

Conversation

@platonicsock

Copy link
Copy Markdown
Contributor

This is an imported playground subtree retaining its existing licensing.

@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (8efe661) to head (a8482f4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3510   +/-   ##
=======================================
  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.

@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: f5ce70a402

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

@@ -0,0 +1,32 @@
[package]

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 Opt the nested UI crate out of the parent workspace

In this repository this manifest sits below anneal/v1/Cargo.toml, which declares a workspace, but the new playground UI crate is neither listed as a workspace member/exclude nor declared as its own workspace. As a result, Cargo aborts before building (cargo check --manifest-path anneal/v1/playground/rust-anneal-playground/ui/Cargo.toml --locked reports that the package believes it is in a workspace when it is not), which breaks the documented cd ui && cargo run backend path unless the playground is copied out of the repo. Add an empty [workspace] here or update the parent workspace membership/excludes; the same applies to other standalone manifests such as top-crates.

Useful? React with 👍 / 👎.

(dispatch, getState) => {
const state = getState();
const sequenceNumber = currentExecutionSequenceNumberSelector(state);
if (sequenceNumber) {

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 Treat sequence number 0 as active

When the first WebSocket execution is active, currentExecutionSequenceNumberSelector returns 0 because the sequence generator starts at zero, so this truthiness check suppresses every action built by dispatchWhenSequenceNumber (wsExecuteStdin, stdin close, and Kill). The observer uses the same zero check for its auto-kill path, so the first long-running Run/Anneal request cannot be killed or fed stdin from the UI until it exits or the socket disconnects; check for undefined/null instead of truthiness.

Useful? React with 👍 / 👎.

- name: Checkout code
uses: actions/checkout@v6
with:
ref: "${{ github.event.pull_request.head.sha }}"

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 Avoid running PR head code under pull_request_target

Because this workflow is triggered by pull_request_target and then checks out github.event.pull_request.head.sha, a labeled external PR controls the repository contents used by later steps, including the local composite action after the GHCR secret login. In that scenario a PR can modify .github/actions/build-and-push-image/action.yml (or other checked-out scripts) to execute arbitrary commands with the workflow token/secrets once a maintainer applies CI: approved; run untrusted PR code under pull_request without secrets, or keep pull_request_target on trusted base-repo code only.

Useful? React with 👍 / 👎.

Comment on lines +398 to +402
const ANNEAL_CARGO_TOML_CONTENT: &str = r#"[package]
name = "anneal-submission"
version = "0.0.0"
edition = "2021"

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 Preserve the selected edition for Anneal submissions

Anneal requests carry ExecuteRequest.edition, but this static Cargo.toml always writes edition = "2021" and should_modify_cargo_toml skips the normal edition update for Anneal. When the UI default/selected edition is 2024 and the submitted code uses 2024-only syntax, Verify with Anneal will compile it as 2021 and fail even though the same editor configuration is valid; generate this value from self.edition instead of hard-coding it.

Useful? React with 👍 / 👎.

.init();

let config = Config::from_env();
server_axum::serve(config);

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 Await the Axum server future

server_axum::serve is an async fn, so this call only constructs and immediately drops the future; no Tokio runtime is entered and the backend process exits after configuration instead of binding the listener. This breaks both local cargo run and the deployed systemd service because the server never starts; make main a Tokio async main and await serve(config).

Useful? React with 👍 / 👎.

Import the Rust Anneal playground source under anneal/v1/playground so it can live alongside the Anneal implementation.
@platonicsock
platonicsock force-pushed the add-rust-anneal-playground branch from f5ce70a to a8482f4 Compare July 31, 2026 22:11
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