Skip to content

[optimizer] Add template prefix tracker and enhance offline analysis capabilities#91

Merged
Tyndalllll merged 4 commits intomainfrom
feat/optimizer
Apr 9, 2026
Merged

[optimizer] Add template prefix tracker and enhance offline analysis capabilities#91
Tyndalllll merged 4 commits intomainfrom
feat/optimizer

Conversation

@Tyndalllll
Copy link
Copy Markdown
Collaborator

Summary

This PR introduces the template prefix tracker for shared-prefix (system prompt) detection,
enhances block lifecycle tracking, and improves the structure and usability of offline analysis scripts.

Changes

1. Template Prefix Tracker & RadixTree Refactor (1f8a3c5)

  • Add TemplatePrefixTracker: DFS-based shared-prefix (system prompt) detection over RadixTree.
    • Phase 1: extract candidate template nodes by fan-out threshold with nested co-existence support.
    • Phase 2: match each trace to its deepest template node.
    • Phase 3: aggregate per-trace attribution and template summary statistics.

2. Block Lifecycle Tracking Enhancement (42d0bfe)

  • Add block_entry pointer to BlockLifecycleRecord to hold live references during a block's lifespan.
  • Update lifecycle_plot.py to prioritize evicted blocks when annotating the physical lifespan CDF.

3. Analysis Script Output Structure (871cb8f)

  • Reorganize script output into structured subdirectories per analysis type.

qoderai[bot]

This comment was marked as resolved.

@github-actions github-actions bot added the ai reviewed AI has reviewed this PR label Mar 31, 2026
…cripts

- Updated README.md to provide a comprehensive overview of output directories and file structures for various analysis scripts.
- Modified plotting functions to save generated charts in organized subdirectories within the specified output directory.
- Added a pointer to the BlockEntry in BlockLifecycleRecord to hold references during the block's lifespan.
- Updated the lifecycle_plot.py script to prioritize evicted blocks for statistical annotations in the physical lifespan CDF.
@Tyndalllll Tyndalllll merged commit f557f21 into main Apr 9, 2026
8 checks passed
@Tyndalllll Tyndalllll deleted the feat/optimizer branch April 9, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai reviewed AI has reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant