Skip to content

Commit

Permalink
Merge branch 'lwawrzyniak/fix-replay-hashing' into 'main'
Browse files Browse the repository at this point in the history
Fixed hashing of replay functions and snippets

See merge request omniverse/warp!588
  • Loading branch information
nvlukasz committed Jun 28, 2024
2 parents 3f78715 + 998fae1 commit 6ad884d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Improve memory usage and performance for rigid body contact handling when `self.rigid_mesh_contact_max` is zero (default behavior)
- The `mask` argument to `wp.sim.eval_fk` now accepts both integer and bool arrays
- Support for NumPy >= 2.0
- Fix hashing of replay functions and snippets

## [1.2.1] - 2024-06-14

Expand Down
16 changes: 6 additions & 10 deletions warp/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1495,22 +1495,18 @@ def hash_recursive(module, visited):
ch.update(bytes(sig, "utf-8"))

# source
s = func.adj.source
ch.update(bytes(s, "utf-8"))
ch.update(bytes(func.adj.source, "utf-8"))

if func.custom_grad_func:
s = func.custom_grad_func.adj.source
ch.update(bytes(s, "utf-8"))
ch.update(bytes(func.custom_grad_func.adj.source, "utf-8"))
if func.custom_replay_func:
s = func.custom_replay_func.adj.source
ch.update(bytes(func.custom_replay_func.adj.source, "utf-8"))
if func.replay_snippet:
s = func.replay_snippet
ch.update(bytes(func.replay_snippet, "utf-8"))
if func.native_snippet:
s = func.native_snippet
ch.update(bytes(s, "utf-8"))
ch.update(bytes(func.native_snippet, "utf-8"))
if func.adj_native_snippet:
s = func.adj_native_snippet
ch.update(bytes(s, "utf-8"))
ch.update(bytes(func.adj_native_snippet, "utf-8"))

# Populate constants referenced in this function
if func.adj:
Expand Down

0 comments on commit 6ad884d

Please sign in to comment.