mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2286] [CLOSED] fix(vision): retain image ownership through request preparation #3961
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3961
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2286
Author: @Tsury
Created: 10/13/2026
Status: ❌ Closed
Base:
main← Head:fix/native-vision📝 Commits (1)
0b4d4e8fix(vision): retain image ownership through request preparation📊 Changes
3 files changed (+433 additions, -65 deletions)
View changed files
📝
serve/server.py(+103 -64)📝
serve/test_server.py(+46 -1)➕
serve/test_vision_cache.py(+284 -0)📄 Description
The current image cache keeps records during encode_all, but releases the service FIFO before preparing the combined embedding file. Another request can evict those files between encoding and stat/copy. A refused request with more than 64 cached images can also leave the cache above its bound.
Keep the FIFO and a reentrant image batch lock through encoding, validation and combined-file copying. Defer eviction to the outermost batch's finally block. Preserve combined-file ownership and trim back to 64 afterward. Close encoder pipes during teardown and clean failed startup. On the specific native decoder refusal, retry once through the existing Pillow normalization path; conversion failures retain temporary-file cleanup.
Based on main
a0116b2782a5b82622358c04a06496485d12b2d6. #1072/#1207 addressed retention during encoding; the stock source still exposes the interval through combined-copy. This PR covers that remaining ownership interval instead of duplicating the shipped encode_all change.Validation: 20 focused model-free vision tests pass. The nine cache-lifetime methods fail on stock for eviction/copy ordering or failure-path bounds. Scheduled two-request races check the real cache and copy boundary, with no GPU/model. Existing image marker, temporary-file and shutdown checks pass. The normalization retry tests isolate protocol behavior; they do not qualify a new image decoder.
Command:
python3 -m unittest serve.test_vision_cache serve.test_server.VisionDecode serve.test_server.ImageMarkers serve.test_server.VisionTempFiles serve.test_server.VisionShutdown.No new device build, GPU campaign or deployment. The longer FIFO hold protects request ownership; its throughput cost is unmeasured.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.