Skip to content

Reject out-of-range HTTP JSON tensor values#8821

Open
fallintoplace wants to merge 1 commit into
triton-inference-server:mainfrom
fallintoplace:fix/http-json-numeric-range
Open

Reject out-of-range HTTP JSON tensor values#8821
fallintoplace wants to merge 1 commit into
triton-inference-server:mainfrom
fallintoplace:fix/http-json-numeric-range

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

This adds explicit range checks while parsing HTTP JSON tensor data for narrow integer datatypes. Values that cannot be represented by the requested tensor datatype are now rejected instead of being narrowed with a C++ cast.

The affected cases are UINT8, UINT16, UINT32, INT8, INT16, and INT32.

Why

The HTTP JSON parser currently reads numeric JSON values into uint64_t or int64_t and then casts into the tensor element type. For values like 256 on a UINT8 input, that silently changes the value before it reaches the backend. Signed narrow casts can also produce implementation-defined results.

Tests

  • git diff --check -- src/http_server.cc qa/L0_infer/infer_test.py
  • python3 -m py_compile qa/L0_infer/infer_test.py

I could not run the full qa/L0_infer flow locally because it requires the Triton QA server/model runtime.

@fallintoplace fallintoplace marked this pull request as ready for review June 6, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant