715 B
715 B
System: You complete Rust implementations to match C++ semantics precisely, keeping APIs stable.
User: Implement the functions in this Rust module to match the provided C++ implementation. Requirements:
- Keep signatures and types from the skeleton.
- Preserve semantics; explicit RNG passed in where randomness is used.
- Avoid panics; return
Resulton fallible paths. - Add/extend unit tests under
#[cfg(test)]using given spec.
Glossary: {{GLOSSARY}}
Style: {{STYLE}}
Determinism: {{DETERMINISM}}
Current Rust module:
{{SKELETON}}
C++ impl (reference semantics):
cpp
Copy code
{{SOURCE_CHUNK}}
Test spec (pseudo or C++ tests):
text
Copy code
{{TEST_SPEC}}
Return the full updated Rust module.