Skip to content

Keep Vulkan isolate batches inside the requested slice - #4580

Open
AGInformatique81 wants to merge 1 commit into
ItsNotRexed:mainfrom
AGInformatique81:fix/isolate-batch-bounds
Open

AGInformatique81 wants to merge 1 commit into
ItsNotRexed:mainfrom
AGInformatique81:fix/isolate-batch-bounds

Conversation

@AGInformatique81

Copy link
Copy Markdown

The isolation loop already clamps the number of modules sent to each child. Its cursor still advanced by the requested batch size, so an accepted --isolate-batch near SIZE_MAX could wrap with a nonzero --start and run modules outside the requested slice. Advance by the same clamped length sent to the child.

On WSL x64 with Mesa Lavapipe 26.1.6 (llvmpipe, LLVM 21.1.8), the new regression requests two modules starting at index 2 with the largest accepted batch. The base reported nine successful pipelines. The patch reports exactly two. All seven isolation tests and all seven index tests passed using a GCC C++20 build and synthetic SPIR-V assembled with the repository's Python assembler. --isolate is a POSIX path.

A trial merge with #4576 was clean. Coordination claim. AI-assisted with Codex.

@Kam471 Kam471 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.

Checked 457e0846 on Windows 11.

  • tests/test_vk_pipeline_check_isolate.py -> skipped (1 skipped): the suite raises SkipTest("--isolate is POSIX only") on os.name != "posix", and the changed parent loop is inside #ifndef _WIN32 (vk_pipeline_check.cpp:728), so neither the test nor the changed block can run on this host.
  • I verified the arithmetic instead. With the test's --isolate-batch value (2 * sys.maxsize + 1 = SIZE_MAX = 2^64-1), a C++ size_t stride of SIZE_MAX is -1:
old loop, lo=2 hi=4:
  s=2 count=2
  s=1 count=3   <- below lo: checks outside the requested slice
  s=0 count=4
  ... keeps walking down/wrapping
new loop:
  s=2 count=2
  stops

const batch = std::min(isolate_batch, hi - s); bisect(..., batch); s += batch; cannot wrap and never leaves [lo, hi). git diff --check clean. No blocking issue; the actual --isolate run still needs POSIX CI.

@Flyander Flyander 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.

Reviewed the bounded batch advancement and its slice regression; the cursor now advances by exactly the range sent to the child.

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.

3 participants