[PR #1207] [CLOSED] fix(serve): keep cached images alive through request preparation #3311

Closed
opened 2026-11-07 14:40:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1207
Author: @hulkbig
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: review/vision-cache-lifetime-20261006


📝 Commits (1)

  • 55f48b2 fix(serve): keep cached images alive through request preparation

📊 Changes

3 files changed (+358 additions, -53 deletions)

View changed files

📝 serve/server.py (+76 -53)
📝 serve/test_server.py (+4 -0)
➕ serve/test_vision_cache.py (+278 -0)

📄 Description

Address the bounded image-cache lifetime gap reported in Niko1221/Strata#1072.

Take the service FIFO before a reentrant Vision batch lock and keep both through encoding, marker expansion, validation, and the completed combined-file copy. Defer eviction until the outermost batch exits, then trim the successful raw-image cache back to 64 entries in finally. Repeated images reuse their encoding; downloads remain outside FIFO. Existing combined-file ownership is unchanged.

AI-assisted implementation and independent AI review. CPU/Python model-free verification: 9 new regression methods and 15 existing vision tests pass; 10 external protocol probes pass, including a 65-image loopback HTTP 200 response and separate-process GENI file consumption. Independent verification passes 11 methods and 20 scheduled race repetitions. Focused 24-test suite rerun before publication: passed.

Full server suite: 461 tests, 447 passed, 8 skipped, 6 errors from pre-existing missing regex imports, also observed on the base. No native CUDA/HIP inference, native C++ SVE loader, Windows, realistic embedding-volume stress, disk-full, or throughput validation. The longer FIFO hold is a correctness trade-off with unmeasured throughput cost.

The separate encoder partial-write leak remains out of scope. Review branch only, based on 82f46a8c8f.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1207 **Author:** [@hulkbig](https://github.com/hulkbig) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `review/vision-cache-lifetime-20261006` --- ### 📝 Commits (1) - [`55f48b2`](https://github.com/Niko1221/Strata/commit/55f48b227f157f48ac8d8f0ac0df44f69692e17f) fix(serve): keep cached images alive through request preparation ### 📊 Changes **3 files changed** (+358 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+76 -53) 📝 `serve/test_server.py` (+4 -0) ➕ `serve/test_vision_cache.py` (+278 -0) </details> ### 📄 Description Address the bounded image-cache lifetime gap reported in Niko1221/Strata#1072. Take the service FIFO before a reentrant Vision batch lock and keep both through encoding, marker expansion, validation, and the completed combined-file copy. Defer eviction until the outermost batch exits, then trim the successful raw-image cache back to 64 entries in finally. Repeated images reuse their encoding; downloads remain outside FIFO. Existing combined-file ownership is unchanged. AI-assisted implementation and independent AI review. CPU/Python model-free verification: 9 new regression methods and 15 existing vision tests pass; 10 external protocol probes pass, including a 65-image loopback HTTP 200 response and separate-process GENI file consumption. Independent verification passes 11 methods and 20 scheduled race repetitions. Focused 24-test suite rerun before publication: passed. Full server suite: 461 tests, 447 passed, 8 skipped, 6 errors from pre-existing missing regex imports, also observed on the base. No native CUDA/HIP inference, native C++ SVE loader, Windows, realistic embedding-volume stress, disk-full, or throughput validation. The longer FIFO hold is a correctness trade-off with unmeasured throughput cost. The separate encoder partial-write leak remains out of scope. Review branch only, based on 82f46a8c8f475f001ad76d92f58f4a4f8ffb0253. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:33 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3311
No description provided.