Skip to content

[WIP] Caching for cuslide2#1034

Open
cdinea wants to merge 23 commits intomainfrom
feature/caching
Open

[WIP] Caching for cuslide2#1034
cdinea wants to merge 23 commits intomainfrom
feature/caching

Conversation

@cdinea
Copy link
Contributor

@cdinea cdinea commented Mar 3, 2026

Description

Implements tile-level caching for cuslide2's single-region read_region() path

Key changes

  • Tile-level caching (ifd.cpp)
  • Decomposes each read_region() ROI into its constituent TIFF tiles, performs per-tile cache lookups via cuCIM's existing ImageCache API, decodes only cache-miss tiles via nvImageCodec, inserts decoded tiles into the cache, and assembles the final output raster.
  • Reuses cuslide's cache infrastructure (create_key, find, lock/unlock, allocate, insert) — no new cache backend code.
  • Fixed hash_value_ to include the file handle hash (file_hash ^ splitmix64(ifd_index)) for cross-file cache key uniqueness.
  • Edge tiles are clipped to actual image bounds; decode failures fill with background_value.
  • Tiles always cached in host memory; GPU output transferred via a single cudaMemcpy(H2D) after assembly.
  • Falls back to direct ROI decode when caching is not applicable (strip-based images, out-of-bounds ROI, or no_cache mode).

cdinea and others added 22 commits February 23, 2026 17:58
Co-authored-by: jakirkham <jakirkham@gmail.com>
Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
…ec.h

Co-authored-by: jakirkham <jakirkham@gmail.com>
@cdinea cdinea requested review from a team as code owners March 3, 2026 16:53
@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 3, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cdinea cdinea self-assigned this Mar 3, 2026
@cdinea cdinea added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Mar 3, 2026
@cdinea
Copy link
Contributor Author

cdinea commented Mar 3, 2026

/ok to test 87618ac

@cdinea cdinea changed the title [WIP] Caching [WIP] Caching for cuslide2 Mar 3, 2026
@cdinea
Copy link
Contributor Author

cdinea commented Mar 3, 2026

/ok to test 5ee97fa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant