Skip to content

[pull] master from tensorflow:master - #8792

Merged
pull[bot] merged 5 commits into
Cache-Cloud:masterfrom
tensorflow:master
Aug 30, 2026
Merged

[pull] master from tensorflow:master#8792
pull[bot] merged 5 commits into
Cache-Cloud:masterfrom
tensorflow:master

Conversation

@pull

@pull pull Bot commented Aug 30, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

saksham-1304 and others added 5 commits January 30, 2026 20:48
…unction

When Python's random module functions are used inside tf.function,
the values are computed during tracing and become constants. This
causes issues with XLA compilation when input shapes don't match
the traced constant values.

This change adds detection for Python random module functions and
issues a helpful warning guiding users to use tf.random functions
instead.

Fixes #109111
Imported from GitHub PR #118856

## Summary

Adds centralized validation for metadata-driven `chunk_index` values before vector access in proto splitter merge and fingerprint parsing paths.

Malformed `.cpb` metadata could previously trigger unchecked indexing into `chunks` / `chunks_info` vectors during merge and fingerprint processing.

This change introduces a shared `ValidateChunkIndex()` helper and applies it consistently across all affected metadata-driven lookup paths.

## Changes

- Add shared `ValidateChunkIndex(uint64_t, size_t)` helper in `proto_splitter/cc/util.{h,cc}`
- Validate root chunk indices in `Merger::Merge()`
- Validate root chunk indices in `Merger::ReadFields()`
- Validate nested chunk indices in `Merger::ProcessField()` (`READ` and `MERGE`)
- Validate chunk indices in SavedModel fingerprint parsing paths
- Add regression coverage for invalid root and nested chunk indices
- Add regression coverage for invalid fingerprint metadata

## Behavior

Before:
- Malformed metadata could reach unchecked vector indexing paths

After:
- Invalid chunk indices fail deterministically with
  `absl::StatusCode::kFailedPrecondition`

## Testing

Added regression tests for:
- invalid root merge chunk index
- invalid nested merge chunk index
- invalid `ReadPartial()` metadata
- invalid fingerprint parsing chunk index
Copybara import of the project:

--
575231f by jmestwa-coder <jmestwa@gmail.com>:

Validate metadata-driven chunk indices before vector access

Merging this change closes #118856

COPYBARA_INTEGRATE_REVIEW=#118856 from jmestwa-coder:validate-chunk-index-bounds 575231f
PiperOrigin-RevId: 973205398
@pull pull Bot locked and limited conversation to collaborators Aug 30, 2026
@pull pull Bot added the ⤵️ pull label Aug 30, 2026
@pull
pull Bot merged commit fb9f3d9 into Cache-Cloud:master Aug 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants