Skip to content

Fix deferred rendering for PRNG key arrays#73

Closed
abhinav-bellapu wants to merge 1 commit into
google-deepmind:mainfrom
abhinav-bellapu:agent/fix-prng-key-deferred-rendering
Closed

Fix deferred rendering for PRNG key arrays#73
abhinav-bellapu wants to merge 1 commit into
google-deepmind:mainfrom
abhinav-bellapu:agent/fix-prng-key-deferred-rendering

Conversation

@abhinav-bellapu

Copy link
Copy Markdown

Summary

  • render typed PRNG key arrays through their numeric key data before truncation
  • preserve JAX's native typed-key representation without materializing large arrays in full
  • cover every built-in PRNG implementation for one- and two-dimensional key batches

Root cause

The deferred representation path passed JAX's extended PRNG key dtype directly to NumPy. NumPy cannot represent that dtype, so expanding a sufficiently large key array raised TypeError instead of rendering it.

Fixes #71.

Validation

  • uv run pyink treescope tests --check
  • uv run pylint treescope
  • uv run python run_tests.py (180 passed, 1 skipped)
  • uv run pytype --jobs auto treescope

@google-cla

google-cla Bot commented Jul 12, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

Large arrays of PRNG keys cannot be deferred

1 participant