Skip to content

fix(utils): preserve explicit zero slice stops - #201

Open
dajiaohuang wants to merge 2 commits into
abetlen:mainfrom
dajiaohuang:fix/utils-empty-slice-stop
Open

dajiaohuang wants to merge 2 commits into
abetlen:mainfrom
dajiaohuang:fix/utils-empty-slice-stop

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Oct 21, 2026 •

Copy link
Copy Markdown

Summary

  • Preserve an explicit stop=0 in ggml.utils.slice_tensor; slice(0, 0) now requests a zero-length view instead of the full axis.
  • Add a focused regression test with a synthetic ggml API fixture, so the Python wrapper can be tested without a native build.
  • Add the required Unreleased changelog entry.

Verification

  • The regression failed before the fix (view API received (4, 0)) and passes after it ((0, 0)). Local command: PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 py -3.13 -B -m pytest -q tests/test_slice_tensor_empty.py — 1 passed.
  • ruff check --no-cache ggml tests and ruff format --check --no-cache --exclude ggml/ggml.py ggml tests pass.
  • The full native suite/build was not run locally; CMake/compiler are unavailable in PATH. No model assets, inference, or external AI service were used.

This branch has not been deployed

No deployments
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