From 4153c122a32e0188653b10da9fd4e1767adcb542 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Fri, 9 Oct 2026 10:21:22 +0300 Subject: [PATCH] perf(simulation): copy native ray hits without NumPy protocol probing --- simulation/ai-polygon/mounted_sensors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simulation/ai-polygon/mounted_sensors.py b/simulation/ai-polygon/mounted_sensors.py index 20b921a6..946b36a9 100644 --- a/simulation/ai-polygon/mounted_sensors.py +++ b/simulation/ai-polygon/mounted_sensors.py @@ -296,7 +296,10 @@ def mounted_range_returns(query, origin, directions, key, spec, forward, *, str(hit.get("rigidBody", "")).startswith("/World/Rover") or str(hit.get("collision", "")).startswith("/World/Rover") ): - positions[row] = hit["position"] + point = hit["position"] + # NumPy probes arbitrary sequence protocols on pybind Float3, + # which is much slower than reading its three exact components. + positions[row] = (point[0], point[1], point[2]) paths[row] = str(hit.get("collision", "")) distances = np.linalg.norm(positions - origin, axis=1) depth = np.full(count, np.nan, np.float32)