text stringlengths 0 252 |
|---|
assert actual["plane_wave_counts"] == expected["plane_wave_counts"] |
for family in ("layer_a", "layer_b"): |
for key in ("rms", "normalized_rms", "mean_absolute_error"): |
assert math.isclose( |
float(actual["fit_residuals"][family][key]), |
float(expected["fit_residuals"][family][key]), |
rel_tol=1e-3, |
abs_tol=2e-6, |
) |
for key in ( |
"rms", |
"normalized_rms", |
"mean_absolute_error", |
"pearson_correlation", |
"fourier_magnitude_relative_l2", |
): |
assert math.isclose( |
float(actual["reconstruction_residuals"][key]), |
float(expected["reconstruction_residuals"][key]), |
rel_tol=1e-3, |
abs_tol=2e-6, |
) |
for key in ("layer_a", "layer_b", "moire"): |
> assert math.isclose( |
float(actual["amplitude_sums"][key]), |
1.0, |
rel_tol=0.0, |
abs_tol=2e-10, |
) |
E assert False |
E + where False = <built-in function isclose>(1.0971352243748504, 1.0, rel_tol=0.0, abs_tol=2e-10) |
E + where <built-in function isclose> = math.isclose |
E + and 1.0971352243748504 = float(1.0971352243748504) |
test_outputs.py:423: AssertionError |
_ test_submitted_solver_generalizes_to_hidden_crop_and_alternate_configuration _ |
def test_submitted_solver_generalizes_to_hidden_crop_and_alternate_configuration() -> ( |
None |
): |
> bundle, reference = heldout_bundle_and_reference() |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
test_outputs.py:760: |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
test_outputs.py:640: in heldout_bundle_and_reference |
assert_isolation_contract( |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
forbidden_paths = (PosixPath('/verifier'), PosixPath('/verifier/heldout_config.json'), PosixPath('/verifier/reference_model.py'), PosixPath('/verifier/test_outputs.py'), PosixPath('/oracle'), PosixPath('/oracle/analyze_stm.py'), ...) |
evidence_path = PosixPath('/logs/verifier/heldout-isolation-probe.json') |
def assert_isolation_contract( |
forbidden_paths: Sequence[Path], |
evidence_path: Path, |
) -> None: |
identity = _runtime_identity() |
evidence_path.parent.mkdir(parents=True, exist_ok=True) |
if identity is None: |
evidence_path.write_text( |
json.dumps({"status": "skipped-outside-container"}, indent=2) + "\n", |
encoding="utf-8", |
) |
return |
expected_paths = [str(path) for path in forbidden_paths] |
expected_egress = [f"{host}:{port}" for host, port in EGRESS_PROBE_TARGETS] |
probe_fd, probe_name = tempfile.mkstemp( |
prefix=".frontierphysics-read-probe-", |
dir="/tmp", |
) |
os.close(probe_fd) |
probe_source = Path(probe_name) |
probe_source.write_text( |
"import json, os, pathlib, socket, sys\n" |
"request = json.loads(pathlib.Path(sys.argv[1]).read_text())\n" |
"paths = request['paths']\n" |
"targets = request['egress']\n" |
"path_results = {}\n" |
"for value in paths:\n" |
" try:\n" |
" path = pathlib.Path(value)\n" |
" if path.is_dir():\n" |
" list(path.iterdir())\n" |
" else:\n" |
" with path.open('rb') as stream:\n" |
" stream.read(1)\n" |
" except Exception as error:\n" |
" path_results[value] = {'readable': False, 'error': type(error).__name__}\n" |
" else:\n" |
" path_results[value] = {'readable': True, 'error': None}\n" |
"egress_results = {}\n" |
"for host, port in targets:\n" |
" key = f'{host}:{port}'\n" |
" connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" |
" connection.settimeout(2.0)\n" |
" try:\n" |
" connection.connect((host, int(port)))\n" |
" except OSError as error:\n" |
" egress_results[key] = {\n" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.