ray_tracing: salvage tf-wait and darwin build fixes - #3708
Conversation
…/ray_tracing_tf Give up a tf wait early once every edge has passed the requested stamp, make the wait timeout a config field, and fix the darwin nix build (bin-only, no python cdylib link) with cache-stable crate store paths.
Greptile SummaryThis change makes the ray-tracing transform wait configurable, adds an early return for timestamped transform lookups, and updates the native Nix build path. Focused Rust checks reproduced two failures: Confidence Score: 3/5Not safe to merge until transform waits preserve valid late samples and invalid timeout values cannot crash point-cloud processing. Two independent runtime failures were reproduced with focused Rust tests that exercised the relevant production behavior and included normal control inputs. Files Needing Attention:
What T-Rex did
|
| // Edges only append forward in time, so once the stalest edge on the | ||
| // path has passed the requested stamp no sample can still arrive. | ||
| if self.no_sample_can_still_arrive() { | ||
| self.warn_unresolved(); | ||
| return None; | ||
| } |
There was a problem hiding this comment.
no_sample_can_still_arrive() treats a newer buffered edge as proof that no usable transform can arrive. TBuffer::add still accepts in-window samples out of timestamp order, however. A lookup for 5.0 with 0.1 tolerance returns None immediately when 5.2 is buffered, even if a 5.05 sample arrives before the configured timeout and resolves the lookup. Do not use the newest timestamp as a terminal condition unless out-of-order samples are rejected consistently; otherwise continue waiting until the deadline.
Artifacts
Focused Rust regression test source for delayed out-of-order transform
- This temporary test seeds a too-new edge, waits for a delayed older in-tolerance edge, and asserts both wait-time and post-arrival lookup behavior; it exercises the claimed failure path.
Focused Rust test output showing early None before accepted late sample
- The exact focused cargo test ran once and failed with “within returned None even though the later 5.05 sample was accepted,” demonstrating the bug.
| /// How long to wait for a late transform before dropping a cloud (s). | ||
| #[validate(range(min = 0.0))] | ||
| pub tf_wait_timeout_s: f64, |
There was a problem hiding this comment.
The lower-bound-only validator accepts finite values such as 1e300, but point-cloud handling converts this value with Duration::from_secs_f64, which panics when the value cannot be represented as a Duration. Reject non-finite and oversized timeout values during configuration validation, or use a checked conversion and handle invalid configuration without panicking.
Artifacts
Focused Rust reproduction test source
- The executed source constructs production configuration values, invokes validation, and runs the exact `Duration::from_secs_f64` expression from the point-cloud handler, showing the tested scope.
Baseline timeout conversion output
- Executed cargo test with `TEST_TIMEOUT=0.1`; validation was accepted and duration conversion did not panic, establishing the normal control behavior.
Oversized finite timeout reproduction output
- Executed cargo test with finite `TEST_TIMEOUT=1e300`; validation was accepted and the exact duration conversion panicked, reproducing the claim.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
aclauer
left a comment
There was a problem hiding this comment.
Ah yeah this should def be configurable.
Bu also this config is for how long we wait for a transform that fits the tolerance criteria before giving up, so if the robot publishes slowly, don't you want to change the tf_match_tolerance?
tf_wait_timeout_sconfigurable (for slow-moving robots with slow odom)