diff options
| author | Stefan Boberg <[email protected]> | 2024-12-17 14:45:27 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-12-17 14:45:27 +0100 |
| commit | 1ccfb3c387773f3b7b396ad2a775dc08b00e8109 (patch) | |
| tree | 636678458dcd30d96e53503594a2b943cfd56336 /src/zencore/memory/llm.cpp | |
| parent | 5.5.17-pre0 (diff) | |
| download | zen-1ccfb3c387773f3b7b396ad2a775dc08b00e8109.tar.xz zen-1ccfb3c387773f3b7b396ad2a775dc08b00e8109.zip | |
Miscellaneous minor LLM fixes (#268)v5.5.17-pre0
With this change, LLM tags are assigned using the name,parent tuple rather than just by name only. This allows tag hierarchies like `cache/store` and `project/store` which would previously get collapsed into the first pair seen when registering the `store` tag.
This PR also adds some more LLM tag annotations to more accurately associate memory allocations with subsystems
In addition, this PR also tweaks the frequency of timer marker events to increase the resolution in Insights and avoid some cases of Insights deciding that marker events are too far apart since we don't allocate as frequently as UE tends to.
Diffstat (limited to 'src/zencore/memory/llm.cpp')
| -rw-r--r-- | src/zencore/memory/llm.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/zencore/memory/llm.cpp b/src/zencore/memory/llm.cpp index fe4853d49..61fa29a66 100644 --- a/src/zencore/memory/llm.cpp +++ b/src/zencore/memory/llm.cpp @@ -15,6 +15,7 @@ static const int32_t TagNamesBaseIndex = 256; static const int32_t TrackedTagNameCount = 256; static const char* TagNames[TrackedTagNameCount]; static uint32_t TagNameHashes[TrackedTagNameCount]; +static int32_t ParentTags[TrackedTagNameCount]; static RwLock TableLock; @@ -46,7 +47,7 @@ FLLMTag::AssignAndAnnounceNewTag(const char* TagName) for (int TagIndex = 0; TagIndex <= CurrentMaxTagIndex; ++TagIndex) { - if (TagNameHashes[TagIndex] == TagNameHash) + if (TagNameHashes[TagIndex] == TagNameHash && ParentTags[TagIndex] == m_ParentTag) { m_Tag = TagIndex + TagNamesBaseIndex; // could verify the string matches here to catch hash collisions @@ -64,6 +65,7 @@ FLLMTag::AssignAndAnnounceNewTag(const char* TagName) { TagNameHashes[TagIndex] = TagNameHash; TagNames[TagIndex] = TagName; + ParentTags[TagIndex] = m_ParentTag; } else { |