MCPcopy Create free account
hub / github.com/Niko1221/Strata / pinned

Method pinned

engine/src/core/expert_source.cpp:5312–5323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5310}
5311
5312bool FileExpertSource::pinned(int64_t layer, int64_t expert) const {
5313 if (!complement_ready_ || !complement_pinned_ || complement_host_ == nullptr || layer < 0 || expert < 0 ||
5314 layer >= n_layers_ || expert >= n_expert_) return false;
5315 const size_t index = (size_t) layer * (size_t) n_expert_ + (size_t) expert;
5316 if (exchange_storage_.active()) return exchange_storage_.resident(index).host != nullptr;
5317 // soft_commit_exchanges: a staged `out` is judged by the place it will take (`in`'s), as after the commit
5318 const size_t at_index = !soft_in_.empty() && soft_in_[index] != SIZE_MAX ? soft_in_[index] : index;
5319 if (at_index >= complement_offsets_.size() || complement_offsets_[at_index] == kNoComplement) return false;
5320 // a partial pin (CS-T): only the registered prefix
5321 return !complement_partial_ ||
5322 complement_offsets_[at_index] + layer_blob_bytes_[(size_t) layer] <= complement_pin_limit_;
5323}
5324
5325const uint8_t* FileExpertSource::device_alias(int64_t layer, int64_t expert) const {
5326 if (!pinned(layer, expert) || complement_device_ == nullptr) return nullptr;

Callers 8

request_lockedMethod · 0.45
mainFunction · 0.45
prefill.cppFile · 0.45
lm_runMethod · 0.45
test_rotating_sourceFunction · 0.45
test_foresight_exchangeFunction · 0.45
test_replace_residentFunction · 0.45

Calls 7

expert_layoutFunction · 0.85
activeMethod · 0.45
residentMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
blob_bytesMethod · 0.45
blob_offsetMethod · 0.45

Tested by 4

mainFunction · 0.36
test_rotating_sourceFunction · 0.36
test_foresight_exchangeFunction · 0.36
test_replace_residentFunction · 0.36