Skip to content

feat: encapsulate SlicedProcessedDatabase behind ProcessedDatabase trait#2186

Draft
dkales wants to merge 1 commit into
mainfrom
dk/db_loading_encaps
Draft

feat: encapsulate SlicedProcessedDatabase behind ProcessedDatabase trait#2186
dkales wants to merge 1 commit into
mainfrom
dk/db_loading_encaps

Conversation

@dkales
Copy link
Copy Markdown
Collaborator

@dkales dkales commented Jun 5, 2026

Introduce a ProcessedDatabase trait covering the per-slice record-movement operations (load_single_record_from_db/s3, write_at_index, preprocess, prefetch_chunk, prefetch_subset) and implement it for SlicedProcessedDatabase. The GPU engine context is passed in via &ShareDB, which already carries code_length and the device manager, so the previous loose n_shards/code_length parameters collapse away.

The operation bodies move out of ShareDB / the free write_db_at_index fn into the trait impl; alloc_db (construction), load_full_db (test-only composite) and register_host_memory stay inherent/on DeviceManager. ServerActor's InMemoryStore impl and the dedup/insertion paths now drive the store through the trait.

No behavioral change; pure refactor. ServerActor remains concrete over the single GPU implementation (generic/dyn dispatch deferred).

@dkales dkales force-pushed the dk/db_loading_encaps branch from 5ccc93b to 87e470a Compare June 5, 2026 13:55
Introduce a ProcessedDatabase trait covering the per-slice record-movement
operations (load_single_record_from_db/s3, write_at_index, preprocess,
prefetch_chunk, prefetch_subset) and implement it for SlicedProcessedDatabase.
The GPU engine context is passed in via &ShareDB, which already carries
code_length and the device manager, so the previous loose n_shards/code_length
parameters collapse away.

The operation bodies move out of ShareDB / the free write_db_at_index fn into
the trait impl; alloc_db (construction), load_full_db (test-only composite) and
register_host_memory stay inherent/on DeviceManager. ServerActor's InMemoryStore
impl and the dedup/insertion paths now drive the store through the trait.

No behavioral change; pure refactor. ServerActor remains concrete over the
single GPU implementation (generic/dyn dispatch deferred).
@dkales dkales force-pushed the dk/db_loading_encaps branch from 87e470a to 59c0cad Compare June 5, 2026 13:56
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