-
Notifications
You must be signed in to change notification settings - Fork 23
WIP DO NOT MERGE Fix: save_map_binary wrote scenario_id prefix that C never reads #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -799,9 +799,8 @@ def save_map_binary(map_data, output_file, unique_map_id): | |
| sdc_track_index = metadata.get("sdc_track_index", -1) # -1 as default if not found | ||
| tracks_to_predict = metadata.get("tracks_to_predict", []) | ||
|
|
||
| # Write original scenario_id with fallback to placeholder | ||
| scenario_id = map_data.get("scenario_id", f"map_{unique_map_id:03d}") | ||
| f.write(struct.pack("16s", scenario_id.encode("utf-8"))) | ||
| # Note: C load_map_binary does NOT read a scenario_id prefix. | ||
| # Do not write one here or the binary will be misaligned. | ||
|
|
||
| # Write sdc_track_index | ||
| f.write(struct.pack("i", sdc_track_index)) | ||
|
Comment on lines
+802
to
806
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The note here is easy to misread as “scenario_id isn’t part of the binary at all”, but
load_map_binarydoes read anint scenario_idper-entity. Consider rewording to explicitly say “the file must start withsdc_track_index(no 16-byte string prefix)” and/or referencepufferlib/ocean/drive/drive.h:1060to prevent confusion.