Skip to content

Conversation

@lola831
Copy link
Collaborator

@lola831 lola831 commented Dec 4, 2025

Description

This PR makes the .snet cache also depend on map options.
I added a new deterministicHash helper and use it for both map options and scene serialization (CompileOptions.hash).
Since the scene options hash changed, I bumped the scene format version to 3.

Issue Link

#393

Checklist

  • I have tested the changes locally via pytest and/or other means
  • I have added or updated relevant documentation
  • I have autoformatted the code with black and isort
  • I have added test cases (if applicable)

Additional Notes

N/A

@lola831 lola831 requested a review from dfremont December 4, 2025 00:39
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.04%. Comparing base (73a3580) to head (09cb0f6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/scenic/domains/driving/roads.py 92.85% 1 Missing ⚠️
src/scenic/syntax/translator.py 90.90% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #425      +/-   ##
==========================================
+ Coverage   89.93%   90.04%   +0.11%     
==========================================
  Files          54       54              
  Lines       13562    13585      +23     
==========================================
+ Hits        12197    12233      +36     
+ Misses       1365     1352      -13     
Files with missing lines Coverage Δ
src/scenic/core/serialization.py 91.46% <100.00%> (+0.51%) ⬆️
src/scenic/domains/driving/roads.py 95.30% <92.85%> (+1.03%) ⬆️
src/scenic/syntax/translator.py 93.57% <90.90%> (+1.48%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

"""Changing map options should invalidate and rewrite the cached .snet file."""
# Get the temp copy of Town01 from cached_maps.
xodr_loc = cached_maps[str(mapFolder / "CARLA" / "Town01.xodr")]
xodr_path = Path(str(xodr_loc))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a future PR: we should switch from tmpdir_factory to tmp_path_factory so that we already have Path objects and don't need to do this conversion.

Copy link
Collaborator

@dfremont dfremont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great -- just one very minor change and a suggestion for later. Also we'll need to fix the merge conflicts.

@lola831 lola831 requested a review from dfremont December 16, 2025 19:16
@dfremont dfremont merged commit c880a55 into BerkeleyLearnVerify:main Dec 16, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants