forked from PufferAI/PufferLib
-
Notifications
You must be signed in to change notification settings - Fork 15
Fixes: Align WOSAC metric calculation with original #258
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
Merged
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
pufferlib/ocean/drive/drive.h
Outdated
| // Maximum number of agents per scene | ||
| #ifndef MAX_AGENTS | ||
| #define MAX_AGENTS 32 | ||
| #define MAX_AGENTS 64 |
Author
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.
Note to self: remember to revert MAX_AGENTS
… the traffic light metric.
Greptile SummaryThis PR fixes three critical bugs that were causing discrepancies between PufferDrive's WOSAC metric calculation and the original implementation. Key Changes:
Additional improvements:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Evaluator as WOSACEvaluator
participant Env as PufferEnv
participant Metrics as metrics module
participant Estimators as estimators module
Evaluator->>Env: collect_ground_truth_trajectories()
Env->>Env: get_global_ground_truth_trajectories()
Note over Env: Now includes is_vehicle field
Env-->>Evaluator: trajectories with is_vehicle
Evaluator->>Env: collect_simulated_trajectories()
Env-->>Evaluator: simulated trajectories
Evaluator->>Evaluator: compute_metrics()
Note over Evaluator: Compute log-likelihoods for each metric
Evaluator->>Estimators: log_likelihood_estimate()
Estimators-->>Evaluator: log-likelihood values
Note over Evaluator: Average log-likelihoods over time (per agent)
Evaluator->>Metrics: _reduce_average_with_validity()
Note over Metrics: For TTC: filter by is_vehicle
Metrics-->>Evaluator: averaged log-likelihoods
Note over Evaluator: Group by scenario_id and average
Evaluator->>Evaluator: df.groupby("scenario_id").mean()
Note over Evaluator: NEW: Exponentiate AFTER averaging
Evaluator->>Evaluator: np.exp(scene_level_results)
Note over Evaluator: Compute weighted meta-score
Evaluator->>Evaluator: _compute_metametric()
Note over Evaluator: NEW: No weight normalization (sum=1.0)
Evaluator-->>Evaluator: final WOSAC score
|
WaelDLZ
approved these changes
Jan 17, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Description
We observed a discrepancy between the WOSAC meta-scores from the original implementation and those produced by PufferDrive. This PR resolves the majority of these discrepancies by addressing the bugs below.
Updates
Updated baseline table and scores
The baseline scores are now more representative:
The goal-conditioned self-play RL policy has a meta-score of ~ 0.67, which is close to the score reported in an earlier paper using a similar approach in GPUDrive (score is 0.629, Table 2). The SMART meta-score is almost exactly the same as its score on the real WOSAC leaderboard. We should note that the current scores may still be slightly optimistic as compared to the original. It is not implausible that this optimism comes from the known differences written down below.
Summary of known differences and status
[status=fixed]Order of operations: We were averaging log-likelihood metrics before exponentiating; WOSAC exponentiates first and then averages.[status=fixed]PufferDrive computes the ttc for all agents whereas the original only computes ttc for vehicles[status=fixed]*PufferDrive used to multiply the final meta-score by the total weight (0.95) to compensate for the missing traffic light violation metric. What we do now instead is use the weights from the WOSAC 2024 challenge that did not have a traffic light metric.[status=diff]PufferDrive does not include the traffic light violation as part of the WOSAC meta-score.[status=diff]Original implementation uses the z-axis. PufferDrive omits the z-axis from metric computation since the z-axis is currently not supported.