Fix exact PolyTrack 0.6.2 browser parity - #1
Open
TheSocialNetwork35 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Rust wrapper diverges from PolyTrack 0.6.2's browser simulation even though both run the same physics WASM. Tiny differences in the JavaScript-side setup compound over long runs, so AI/TAS controls produced headlessly are not reproducible in the game.
The main parity differences were:
createCarModel;f32/glam quaternion and mountain calculations rounding earlier than JavaScriptNumberarithmetic;fd_writestub returning an error instead of success.Fix
f64, casting only at the JavaScriptFloat32Arrayboundary.fd_writehost stub.update_car_rawfor byte-for-byte differential testing.parry3ddependency and document the matching 0.6.2 WASM hash.Browser differential proof
Compared against the official PolyTrack 0.6.2 Chromium simulation worker and
polytrack_physics.wasmwith only Forward held:32,948 × 227)2a5941172248cb5c00b6ead247a4ee07bbada6efd2c929f76030eb92a12b034eA separate 1,000-frame run on the existing benchmark track also matched all 227,000 bytes.
Validation
cargo fmt --all -- --checkcargo test --lib— 55 passedcargo clippy --lib -- -D warningsRUSTDOCFLAGS='-D warnings' cargo doc --no-deps