Skip to content

fix: use int32 bounds for semantic sensor observation space#2224

Open
xiaosq2000 wants to merge 2 commits intofacebookresearch:mainfrom
xiaosq2000:dependency-upgrade/numpy
Open

fix: use int32 bounds for semantic sensor observation space#2224
xiaosq2000 wants to merge 2 commits intofacebookresearch:mainfrom
xiaosq2000:dependency-upgrade/numpy

Conversation

@xiaosq2000
Copy link
Copy Markdown

@xiaosq2000 xiaosq2000 commented Apr 11, 2026

Summary

  • Relaxes numpy version requirement to >=1.26.4
  • Fixes OverflowError in HabitatSimSemanticSensor._get_observation_space when running with NumPy 2.0+

The semantic sensor declared dtype=np.int32 but used np.iinfo(np.uint32) for low/high bounds. NumPy <2.0 silently wrapped uint32 max (4294967295) to -1; NumPy 2.0+ enforces strict integer bounds checking and raises:

OverflowError: Python integer 4294967295 out of bounds for int32

Test plan

  • Run any config with semantic_sensor enabled under NumPy 2.0+
  • Verify observation space dtype is int32 and bounds are within range

🤖 Generated with Claude Code

xiaosq2000 and others added 2 commits April 11, 2026 15:37
The semantic sensor's `_get_observation_space` declared `dtype=np.int32`
but used `np.iinfo(np.uint32)` for `low`/`high` bounds. This was
silently accepted by NumPy <2.0 (wrapping uint32 max to -1), but NumPy
2.0+ enforces strict integer bounds checking and raises OverflowError.

Align `low` and `high` with the declared int32 dtype. This is consistent
with `get_observation`, which already casts to int32.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant