From 65339ab54e717a276c9dc9d51b03a83d6697c86c Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Oct 2026 10:22:29 +0000 Subject: [PATCH] test_runtime_child_remap: inject remap body rejects through the boundary record The removed _boundaries list made the two body-reject patches no-ops. Inject them via _device_boundaries (level-2 record with foreign host geometry; non-None level-1 record). set_jet_amplitude docstring names the public jets view. Co-Authored-By: Claude Opus 5.5 --- src/CelerisLab/lbm/refinement_stepper.py | 2 +- tests/unit/test_runtime_child_remap.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/CelerisLab/lbm/refinement_stepper.py b/src/CelerisLab/lbm/refinement_stepper.py index 64e7b8b..4f38244 100644 --- a/src/CelerisLab/lbm/refinement_stepper.py +++ b/src/CelerisLab/lbm/refinement_stepper.py @@ -640,7 +640,7 @@ class FixedPatchStepper: return candidate def set_jet_amplitude(self, index, amplitude, *, level): - """Replace Jet ``index`` of ``level_jets[level]`` between steps; no geometry/table rebuild. + """Replace Jet ``index`` of level ``level`` (``jets[level]``) between steps; no table rebuild. Invalid input raises before any change. A device/sync error marks the instance failed (as step/initialize do); host state commits only after diff --git a/tests/unit/test_runtime_child_remap.py b/tests/unit/test_runtime_child_remap.py index e117c63..f9c4d6e 100644 --- a/tests/unit/test_runtime_child_remap.py +++ b/tests/unit/test_runtime_child_remap.py @@ -1,5 +1,6 @@ """CPU mocks execute production remap lifecycle; no GPU numerical claim.""" from dataclasses import replace +from types import SimpleNamespace import unittest from unittest.mock import patch @@ -69,10 +70,11 @@ class RuntimeChildRemap(unittest.TestCase): run._status = 'ready' for bad in ([], [(40,16,48,40)], [(16,16,32,24),(16,27,32,55)]): with self.assertRaises(ValueError): run.remap_finest(bad) - hosts, pairs = run.boundaries, run.hierarchy.pairs + records, pairs = run._device_boundaries, run.hierarchy.pairs for attribute, value in (('_wall_aware', True), - ('_boundaries', [*hosts[:2], object()]), # child boundary - ('_boundaries', [hosts[0], object(), hosts[2]]), # fine boundary + # level-2 record whose host geometry differs from objects=() + ('_device_boundaries', [*records[:2], SimpleNamespace(host=object(), jets=())]), + ('_device_boundaries', [records[0], object(), records[2]]), # level-1 body ('hierarchy', replace(run.hierarchy, pairs=(pairs[0], None)))): with patch.object(run, attribute, value): with self.assertRaises(ValueError): run.remap_finest(B)