Skip to content

[Feat] Complete process_trace and reader_init_param#271

Merged
haochengxia merged 8 commits intodevelopfrom
hxia/process_trace
Jul 18, 2025
Merged

[Feat] Complete process_trace and reader_init_param#271
haochengxia merged 8 commits intodevelopfrom
hxia/process_trace

Conversation

@haochengxia
Copy link
Copy Markdown
Collaborator

@haochengxia haochengxia commented Jul 18, 2025

  • Fix docs for Python plugins
  • Make the process_trace return byte_miss_ratio and obj_miss_ratio
  • Complete the binding of reader_init_param
  • Add ruff lint and format check into pre-commit

@haochengxia haochengxia requested a review from Copilot July 18, 2025 02:44
@haochengxia haochengxia changed the title [FEAT] Complete process_trace and reader_init_param [Feat] Complete process_trace and reader_init_param Jul 18, 2025

This comment was marked as outdated.

@haochengxia haochengxia requested a review from Copilot July 18, 2025 02:57

This comment was marked as outdated.

@haochengxia haochengxia requested a review from Copilot July 18, 2025 03:51

This comment was marked as outdated.

@haochengxia haochengxia requested review from 1a1a11a and Copilot July 18, 2025 04:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request completes the implementation of process_trace functionality and reader_init_param bindings, along with adding Python linting support. The PR makes process_trace return both object and byte miss ratios, completes the ReaderInitParam bindings with full parameter support, and adds ruff-based Python code quality checks to the pre-commit hooks.

Key Changes

  • Enhanced process_trace to return both object and byte miss ratios instead of just object miss ratio
  • Completed ReaderInitParam bindings with comprehensive parameter support and multiple constructor options
  • Added ruff linting and formatting checks for Python files in the pre-commit hook system

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/setup_hooks.sh Added Python file detection and ruff linting/formatting checks to pre-commit hooks
libCacheSim-python/src/pylibcachesim.cpp Enhanced process_trace functions to return tuple of miss ratios and completed ReaderInitParam bindings
libCacheSim-python/libcachesim/eviction.py Updated process_trace method signatures to return tuple of miss ratios
libCacheSim-python/tests/ Updated test files to handle new tuple return values from process_trace
libCacheSim-python/libcachesim/init.py Added ReaderInitParam to exports and reorganized all list
Documentation files Updated examples and documentation to reflect new process_trace return format

Comment thread libCacheSim-python/src/pylibcachesim.cpp Outdated
Comment thread libCacheSim-python/src/pylibcachesim.cpp Outdated
Comment thread libCacheSim-python/src/pylibcachesim.cpp
Comment thread scripts/setup_hooks.sh Outdated
Comment thread libCacheSim-python/libcachesim/eviction.py Outdated
@haochengxia haochengxia merged commit e205c13 into develop Jul 18, 2025
11 checks passed
if not isinstance(reader, Reader):
# streaming generator
if isinstance(reader, (_ZipfRequestGenerator, _UniformRequestGenerator)):
if isinstance(reader, _GENERATOR_TYPES):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the ideal world, I hope we have streaming reader in C as well, but let's live with it

if not isinstance(reader, Reader):
# streaming generator
if isinstance(reader, (_ZipfRequestGenerator, _UniformRequestGenerator)):
if isinstance(reader, _GENERATOR_TYPES):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need an else and raise

@haochengxia haochengxia deleted the hxia/process_trace branch July 19, 2025 00:08
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.

3 participants