Skip to content

fix(execution): bound large-value reads by their declared size - #10322

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/large-array-manifest-budget
Nov 22, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/large-array-manifest-budget

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Large-array manifests are admitted by the sum of their chunk refs' declared size, but per-chunk reads never tied the real bytes to that size, so sandbox code could repeat one real chunk ref with size: 1 and make the host materialize far past the inline cap (via sim.values.readArray or a loop/parallel collection)
  • Storage reads are now capped at ref.size and reject anything larger
  • The in-process cache refuses to serve a value larger than the ref claims
  • Storage reads are cached by measured bytes, not the caller's declared size, so an inflated ref can't lock out the true ref
  • With declared size an upper bound at both read primitives, the existing aggregate gate holds for every caller

Type of Change

  • Bug fix

Testing

  • New regression tests in large-array-manifest.test.ts (forged download, forged cache hit) and store.test.ts (measured-bytes caching); each goes red with its guard reverted
  • lib/execution/payloads, executor/utils, executor/variables, lib/function-execution, lib/memory, lib/logs/execution suites pass
  • biome; pre-push type-check

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

A large-array manifest is admitted by the sum of its chunk refs' declared
sizes, but per-chunk reads never tied the real stored or cached bytes to that
size. Sandbox code could repeat one real chunk ref with size 1 and force the
host to materialize far past the inline cap.

- Cap storage downloads at ref.size and reject anything larger
- Refuse cached values larger than the ref claims
- Cache storage reads by measured bytes, not the caller's declared size
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 22, 2026 10:58pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Large-value reads now enforce the size declared by the reference.

  • Large-value reads stay within the size their references claim.

No new actionable issues found. Tests were not run during this review.

Reviews (2) · Last reviewed commit: "test(execution): align large-value fixtu..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit f28435c into staging Nov 22, 2026
84 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/large-array-manifest-budget branch November 23, 2026 00:04

This branch was previously deployed

1 inactive deployment
Preview — 28ab3c10 Deployed Nov 22, 2026 by vercel[bot]
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.

1 participant