← Research

WEIGHTWRIGHT Research

SandBox

Understanding the Sandbox

A sandboxed evaluation environment is a safe closed off space where code from a coding model can run and get checked. It is usually a container or a limited virtual setup that stops the code from touching the rest of the computer, using the network freely, or causing damage. This lets us test the code without any risk.

We should always run the generated code and test it instead of just believing what the model says about it. Models often write explanations that sound good but the code itself can still be wrong, incomplete, or full of hidden problems. Only by actually running the code against real tests can we see if it works the way it should.

Testing and Model Comparison

Target tests check that the specific bug or missing feature is fixed. Regression tests check that nothing else that used to work is now broken. When both kinds of tests pass, we know the fix is good and did not create new problems.

FAIL_TO_PASS tests are the ones that fail on the original broken code but pass after the correct fix is added. They show that the model solved the main problem. PASS_TO_PASS tests are the ones that already worked before and must keep working after the change. They show that the fix did not break other parts of the software. A good solution needs both groups to pass.

The base model and the specialist model should use the exact same frozen evaluator. This way any improvement we measure comes from the specialist model itself and not from changes in how the scoring works.

Proposed workflow comparing base and specialist models through a shared frozen evaluator and isolated sandbox.
Proposed editorial illustration — base and specialist models share one frozen evaluator.
Diagram description

The illustration shows an unchanged base checkpoint and a post-trained specialist receiving identical held-out tasks, task definitions, input schemas, target and regression tests, and evaluation conditions. Both model schematics contain transformer blocks, token embeddings and an output layer; SFT and QLoRA appear as example post-training methods. A shared frozen evaluator executes generated code in an isolated workspace with restricted host access, checks FAIL_TO_PASS target tests and PASS_TO_PASS regression tests, then checks edit scope, test integrity and unrelated changes. Its structured report lists task success, regression status, scope compliance, execution time, token usage and computational cost. The report has no measured values.

View full-size diagram (opens in a new tab)

Reliable Evaluation

An evaluator becomes unreliable when the tests are poorly written, when the test environment is different from the real one, when tests sometimes pass and sometimes fail for no clear reason, or when the task description is vague and does not match what the hidden tests actually check.

Anti cheating checks are useful because models can find tricky ways to make tests pass without really solving the problem. They might delete tests, hard code the exact answers the tests expect, or change unrelated files. These checks stop that kind of cheating and keep the scores honest.

A good structured evaluator should clearly report whether the code succeeded, whether any regressions appeared, whether the changes stayed inside the proper scope, and also simple numbers for how long it took, how many tokens were used, and how much it cost.