Skip to content

refactor: compact PMM kernel headers below 180000-byte budget#363

Merged
netkeep80 merged 3 commits into
netkeep80:mainfrom
konard:issue-360-d39150460d13
Apr 26, 2026
Merged

refactor: compact PMM kernel headers below 180000-byte budget#363
netkeep80 merged 3 commits into
netkeep80:mainfrom
konard:issue-360-d39150460d13

Conversation

@konard

@konard konard commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #360.

Summary

  • Compact include/pmm/** from 4810 tracked lines / 208203 bytes to 608 tracked lines / 178855 bytes, below the blocking 5000-line and 180000-byte budgets.
  • Preserve required include anchor comments and existing structural header checks while removing whitespace/comment bulk and shortening repeated template boilerplate.
  • Extend test_issue352_kernel_subtree_size so it loads and enforces both repo-policy size rules.
  • Regenerate single_include/pmm/pmm.h from the compacted modular headers.
  • Add a patch changelog fragment.

Change Contract

change_type: chore
scope:
  - .gitkeep
  - include/pmm/**
  - single_include/pmm/pmm.h
  - tests/test_issue352_kernel_subtree_size.cpp
  - changelog.d/20260426_151700_issue360_kernel_byte_compaction.md
budgets:
  max_new_files: 2
  max_new_docs: 0
  max_net_added_lines: 200
must_touch:
  - include/pmm/persist_memory_manager.h
  - include/pmm/block_state.h
  - include/pmm/typed_manager_api.h
  - single_include/pmm/pmm.h
  - tests/test_issue352_kernel_subtree_size.cpp
must_not_touch:
  - docs/**
  - README.md
  - CHANGELOG.md
  - .github/**
  - demo/**
  - examples/**
  - benchmarks/**
  - scripts/**
expected_effects:
  - Tracked include/pmm kernel source is below the 180000-byte size rule.
  - Tracked include/pmm kernel source remains below the 5000-line size rule.
  - Existing include anchor headings remain valid.
  - Single-header artifacts are refreshed from the compacted modular headers.
  - The regression test enforces both include/pmm line and byte budgets.

Reproduction

  • Before the fix, the extended test_issue352_kernel_subtree_size failed with 208203 <= 180000.
  • After the fix, git ls-files 'include/pmm/**' | xargs wc -l | tail -1 reports 608 total and git ls-files 'include/pmm/**' | xargs wc -c | tail -1 reports 178855 total.

Verification

  • cmake --build build
  • ctest --test-dir build --output-on-failure (94/94 passed)
  • ctest --test-dir build --output-on-failure -R 'test_issue318_manager_header_compaction|test_issue352_kernel_subtree_size|test_issue354_include_anchors'
  • tracked clang-format check matching CI exclusions
  • tracked source file-size check (<=1500 lines)
  • bash scripts/generate-single-headers.sh --output-dir /tmp/... plus diff against single_include/pmm
  • GITHUB_BASE_REF=main bash scripts/check-changelog-fragment.sh
  • bash scripts/check-docs-consistency.sh
  • bash scripts/check-repo-guard-rollout.sh
  • git diff --cached --check

Local note: cppcheck is not installed in this container, so local cppcheck was not run; CI installs and runs it separately.

konard added 2 commits April 26, 2026 15:14
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: netkeep80#360
@konard konard changed the title [WIP] Сжатие кода refactor: compact PMM kernel headers below 180000-byte budget Apr 26, 2026
@konard
konard marked this pull request as ready for review April 26, 2026 15:55
@konard

konard commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

Solution summary

Implemented and pushed the fix.

PR 363 is updated and ready for review: #363

What changed:

  • Compacted include/pmm/** from 4810 lines / 208203 bytes to 608 lines / 178855 bytes.
  • Extended test_issue352_kernel_subtree_size to enforce both the line and byte rules from repo-policy.json.
  • Regenerated single_include/pmm/pmm.h.
  • Added a patch changelog fragment.
  • Preserved include anchors; test_issue354_include_anchors passes.

Verification:

  • Local cmake --build build passed.
  • Local ctest --test-dir build --output-on-failure passed: 94/94.
  • Local format, file-size, single-header freshness, changelog, docs consistency, repo-guard rollout, and diff checks passed.
  • Local cppcheck was unavailable in the container, but GitHub CI installed and ran it successfully.
  • GitHub CI is fully green, including compiler matrix, sanitizers, cppcheck, repo-guard, docs, changelog, and single-header checks.
  • PR is no longer draft and merge state is CLEAN.

Commit pushed: f16ebd0 refactor: compact kernel headers under byte budget.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $23.150962

📊 Context and tokens usage:

  • 15.8M / 1.1M (1503%) input tokens, 51.6K / 130K (40%) output tokens

Total: (561.1K + 15.2M cached) input tokens, 51.6K output tokens, $23.150962 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (57671KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@netkeep80
netkeep80 merged commit 64f15bf into netkeep80:main Apr 26, 2026
18 checks passed
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.

Сжатие кода

2 participants