From 998fae1ffd026fdc9417c726277a61ce79f5112f Mon Sep 17 00:00:00 2001 From: Lukasz Wawrzyniak Date: Fri, 28 Jun 2024 05:59:50 -0700 Subject: [PATCH] Fixed hashing of replay functions and snippets --- CHANGELOG.md | 1 + warp/context.py | 16 ++++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b64a70d82..698a555d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/warp/context.py b/warp/context.py index 0b315e2e4..6fbbd9d6d 100644 --- a/warp/context.py +++ b/warp/context.py @@ -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: