Skip to content

fix(ci): benchmarks and windows build#148

Merged
unclesp1d3r merged 12 commits intomainfrom
fix/ci-benchmarks-and-windows-build
Mar 9, 2026
Merged

fix(ci): benchmarks and windows build#148
unclesp1d3r merged 12 commits intomainfrom
fix/ci-benchmarks-and-windows-build

Conversation

@unclesp1d3r
Copy link
Member

This pull request refactors and improves the benchmarking infrastructure for the project. The main changes include moving benchmark and load test jobs out of the main CI workflow into a dedicated GitHub Actions workflow, updating tool versions for better compatibility and performance, and streamlining benchmark suites for faster execution and easier maintenance. Additionally, several benchmark parameters and test cases have been adjusted to focus on more representative workloads and reduce unnecessary complexity. This also intentionally stubs out the Windows token checks pending the creation of the EvilBit-Labs/token-privilege crate.

Workflow and Infrastructure Changes:

  • Added a new .github/workflows/benchmarks.yml workflow for running benchmarks and load tests, separating them from the main CI workflow and improving maintainability.
  • Removed benchmark and load test jobs from .github/workflows/ci.yml to avoid duplication and streamline CI.

Tooling Updates:

  • Updated multiple tool versions in mise.toml (e.g., cargo-binstall, cargo-insta, cargo-audit, cargo-llvm-cov, cargo-nextest, cargo-release, cargo-auditable, actionlint, lychee, markdownlint-cli2, protobuf, protoc) for improved compatibility and reliability. [1] [2]

Benchmark Suite and Parameter Adjustments:

  • Reduced measurement times and batch sizes across several benchmarks in procmond/benches/performance_benchmarks.rs to speed up test execution and focus on relevant scenarios. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Simplified process collector benchmarks by removing artificial delay simulation, reducing the number of tested process counts, and eliminating redundant high-count and load scenarios. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Justfile Improvements:

  • Added a new bench-procmond target to the justfile for running procmond-specific benchmarks, making it easier to invoke relevant tests.

unclesp1d3r and others added 7 commits March 8, 2026 17:23
…alysis

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
…e detection

Temporary implementation using `whoami /priv` and `whoami /groups` to avoid
unsafe Win32 FFI calls, preserving the workspace-level `unsafe_code = "forbid"`
policy. This will be replaced by the `token-privilege` crate once it is built.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
…ivilege crate

Remove the whoami shell-out approach. Windows now runs in degraded mode
until the token-privilege crate provides safe FFI wrappers for
SeDebugPrivilege and elevation detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
@unclesp1d3r unclesp1d3r self-assigned this Mar 9, 2026
Copilot AI review requested due to automatic review settings March 9, 2026 01:19
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 9, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Caution

Review failed

Failed to post review comments

Summary by CodeRabbit

  • New Features

    • Manual, dedicated benchmarks workflow with selectable suites and separate load-test artifacts
  • Improvements

    • Benchmarks split into focused suites, faster/slimmer defaults, new helper utilities and a local bench target
    • CI no longer runs benchmarks automatically; regression reports are now warnings for review
  • Bug Fixes

    • Windows privilege detection now falls back to degraded mode with a warning
  • Chores

    • Updated development tool versions
  • Documentation

    • Updated testing and contributing docs with benchmark usage and CI guidance

Walkthrough

Extracts benchmarking into a dedicated GitHub Actions workflow, adds focused Criterion bench modules and helpers, splits the large performance bench into multiple suites, shortens/simplifies some benches, updates tooling versions, adds a just target and docs, and replaces Windows privilege detection with a degraded-mode stub.

Changes

Cohort / File(s) Summary
Workflows
\.github/workflows/benchmarks.yml, \.github/workflows/ci.yml
Adds a new manual Benchmarks workflow (benchmarks + load-tests jobs, suite input, baseline restore/save, regression detection, artifacts); removes benchmark steps from main CI.
Bench manifest
procmond/Cargo.toml
Replaces performance_benchmarks with separate benches: wal_benchmarks, eventbus_benchmarks, serialization_benchmarks, system_benchmarks (harness = false).
New bench modules
procmond/benches/wal_benchmarks.rs, procmond/benches/eventbus_benchmarks.rs, procmond/benches/serialization_benchmarks.rs, procmond/benches/system_benchmarks.rs, procmond/benches/bench_helpers.rs
Adds modular Criterion benchmark suites and shared event constructors (minimal, test, large events).
Removed / modified benches
procmond/benches/performance_benchmarks.rs, procmond/benches/process_collector_benchmarks.rs
Removes the monolithic performance_benchmarks; simplifies process_collector_benchmarks (drops artificial delay field/method, shortens measurement times, reduces large-count scenarios).
Dev tooling / docs
justfile, docs/src/contributing.md, docs/src/testing.md
Adds bench-procmond target and updates docs to describe the manual Benchmarks workflow, suite options, and artifact handling.
Tooling config
mise.toml
Bumps multiple tool versions and adds mdbook-related tools (mermaid, toc, admonish, open-on-gh, i18n-helpers).
Security stub
procmond/src/security.rs
Replaces Windows privilege detection implementation with a degraded-mode stub that logs a warning and returns a degraded SecurityContext for Windows.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant GH as GitHub Actions
  participant Runner as Runner (ubuntu-latest)
  participant Cargo as Cargo/Rust toolchain
  participant Cache as Cache/Artifacts

  rect rgba(99,102,241,0.5)
    Dev->>GH: Manually trigger "Benchmarks" with suite
    GH->>Runner: Start job (benchmarks / load-tests)
    Runner->>Runner: checkout code
    Runner->>Runner: install deps (mise-action) & restore cache
    Runner->>Cargo: run `cargo bench` or `cargo test` (suite-specific)
    Cargo-->>Runner: benchmark/test output
    Runner->>Runner: scan output for regressions
    Runner->>Cache: upload artifacts (benchmark-results / load-test-results)
    Runner->>Cache: save/update Criterion baselines (on main)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

size:XL

Poem

🐰 I hopped through files with whiskers bright,
Split the benches, made CI light,
Baselines cached and artifacts stored,
Windows resting, logs adored,
Carrots, crates, and benchmarks — delight! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(ci): benchmarks and windows build' directly corresponds to the main changes: CI workflow refactoring (benchmarks) and Windows privilege-detection stubs, making it a clear and specific summary.
Description check ✅ Passed The description is directly related to the changeset, detailing workflow refactoring, tool updates, benchmark adjustments, justfile improvements, and Windows stubs with comprehensive context and citations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ci-benchmarks-and-windows-build

Comment @coderabbitai help to get the list of available commands and usage tips.

@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 CI must pass

Wonderful, this rule succeeded.

All CI checks must pass. Release-plz PRs are exempt because they only bump versions and changelogs (code was already tested on main), and GITHUB_TOKEN-triggered force-pushes suppress CI.

  • check-success = coverage
  • check-success = quality
  • check-success = test
  • check-success = test-cross-platform (macos-15, macOS)
  • check-success = test-cross-platform (ubuntu-22.04, Linux)
  • check-success = test-cross-platform (windows-2022, Windows)

🟢 Do not merge outdated PRs

Wonderful, this rule succeeded.

Make sure PRs are within 3 commits of the base branch before merging

  • #commits-behind <= 3

@dosubot dosubot bot added configuration Configuration management and settings testing Related to test development and test infrastructure labels Mar 9, 2026
@coderabbitai coderabbitai bot added dependencies Pull requests that update a dependency file integration Related to integration testing and component integration procmond Issues related to the process monitoring daemon size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 9, 2026
@dosubot
Copy link
Contributor

dosubot bot commented Mar 9, 2026

Related Documentation

5 document(s) may need updating based on files changed in this PR:

DaemonEye

CI and Automation Hooks
View Suggested Changes
@@ -4,7 +4,8 @@
 
 All CI/CD workflows are defined in the `.github/workflows/` directory. Key workflows include:
 
-- `ci.yml`: Main CI pipeline for code quality, testing, cross-platform builds, coverage reporting, and performance benchmarks ([ci.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/a169b6886897bf281c27ce9d86d4738233658cd4/.github/workflows/ci.yml)).
+- `ci.yml`: Main CI pipeline for code quality, testing, cross-platform builds, and coverage reporting ([ci.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/a169b6886897bf281c27ce9d86d4738233658cd4/.github/workflows/ci.yml)).
+- `benchmarks.yml`: Performance benchmarks and load tests, run on-demand ([benchmarks.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/main/.github/workflows/benchmarks.yml)).
 - `docs.yml`: Documentation build and deployment to GitHub Pages ([docs.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/a169b6886897bf281c27ce9d86d4738233658cd4/.github/workflows/docs.yml)).
 - `codeql.yml`: Code analysis and security scanning ([codeql.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/a169b6886897bf281c27ce9d86d4738233658cd4/.github/workflows/codeql.yml)).
 - `scorecard.yml`: Supply-chain security analysis using OpenSSF Scorecard ([scorecard.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/main/.github/workflows/scorecard.yml)).
@@ -36,7 +37,6 @@
 - `test` runs independently
 - `test-cross-platform` depends on `quality`
 - `coverage` depends on `test`, `test-cross-platform`, and `quality`
-- `benchmarks` depends on `test`
 
 The Scorecard workflow runs its analysis job only on the default branch or for pull requests, and uploads results to both the code scanning dashboard and as artifacts.
 
@@ -50,14 +50,30 @@
 
 Documentation is built using `mdBook` and Rustdoc, with plugins for enhanced features. The workflow builds and deploys documentation to GitHub Pages, triggered by code changes or manual dispatch ([docs.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/a169b6886897bf281c27ce9d86d4738233658cd4/.github/workflows/docs.yml)).
 
-**Benchmarks Job**
+**Benchmarks Workflow**
 
-Performance benchmarks are executed using Criterion after tests complete. Key features:
-- Caches baseline benchmarks for regression detection
-- Fails CI if performance regressions exceed 10% threshold
-- Runs load tests to validate system behavior under stress
+Performance benchmarks and load tests are executed in a separate `.github/workflows/benchmarks.yml` workflow that runs on-demand via manual trigger (`workflow_dispatch`). This workflow is independent of the main CI pipeline, allowing developers to run performance tests when needed without impacting regular CI execution times.
+
+The workflow provides a configurable `suite` input parameter with the following options:
+- `all` (default): Runs all benchmark suites
+- `performance_benchmarks`: Runs only the performance benchmark suite
+- `process_collector_benchmarks`: Runs only the process collector benchmark suite
+
+The workflow contains two independent jobs that run in parallel:
+
+**Benchmarks Job** (15-minute timeout):
+- Runs `cargo bench --package procmond` (or specific suites based on input)
+- Restores baseline benchmarks from cache for regression detection
+- Checks for performance regressions and logs warnings if detected (does not fail the build)
+- Saves new baseline benchmarks to cache only when running on the main branch
 - Uploads benchmark results as artifacts with 30-day retention
-- Only saves new baselines when running on the main branch
+
+**Load Tests Job** (10-minute timeout):
+- Runs `cargo test --package procmond --test load_tests -- --ignored --nocapture`
+- Validates system behavior under stress
+- Uploads load test results as artifacts with 30-day retention
+
+Unlike the previous CI integration, performance regressions now log warnings but do not fail the build, allowing for more flexible performance monitoring while still alerting maintainers to potential issues.
 
 **Mergify Integration**
 
@@ -98,6 +114,7 @@
 **References**
 
 - [ci.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/a169b6886897bf281c27ce9d86d4738233658cd4/.github/workflows/ci.yml)
+- [benchmarks.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/main/.github/workflows/benchmarks.yml)
 - [docs.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/a169b6886897bf281c27ce9d86d4738233658cd4/.github/workflows/docs.yml)
 - [codeql.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/a169b6886897bf281c27ce9d86d4738233658cd4/.github/workflows/codeql.yml)
 - [scorecard.yml](https://github.com/EvilBit-Labs/DaemonEye/blob/main/.github/workflows/scorecard.yml)

✅ Accepted

contributing /DaemonEye/blob/main/docs/src/contributing.md
View Suggested Changes
@@ -124,6 +124,9 @@
 
 # Run benchmarks
 just bench
+
+# Run procmond benchmarks
+just bench-procmond
 
 # Generate documentation
 just docs

✅ Accepted

Contributing to DaemonEye
View Suggested Changes
@@ -115,14 +115,15 @@
 <!-- §nt:2c1e2c67-d679-4652-8f03-039502a87026 -->
 
 ```bash
-just setup    # Setup development environment
-just build    # Build the project
-just test     # Run tests
-just lint     # Run linting
-just fmt      # Format code
-just bench    # Run benchmarks
-just docs     # Generate documentation
-just clean    # Clean build artifacts
+just setup          # Setup development environment
+just build          # Build the project
+just test           # Run tests
+just lint           # Run linting
+just fmt            # Format code
+just bench          # Run all workspace benchmarks
+just bench-procmond # Run procmond benchmarks (WAL, EventBus, process collection, serialization)
+just docs           # Generate documentation
+just clean          # Clean build artifacts
 ```
 
 <!-- §nt:b809ebe7-083e-4209-a74e-a74d9d78b1ce -->

✅ Accepted

testing /DaemonEye/blob/main/docs/src/testing.md
View Suggested Changes
@@ -336,17 +336,18 @@
 
 ## Performance Testing
 
-### Automated CI Benchmarks
-
-DaemonEye's CI pipeline includes automated performance benchmarking to detect regressions:
-
-- **Automatic Execution**: Performance benchmarks run on every CI build using Criterion
-- **Regression Detection**: Tests automatically detect performance regressions with a 10% threshold
+### Automated Benchmarks
+
+DaemonEye provides a dedicated benchmarking workflow for performance testing:
+
+- **Manual Trigger**: Performance benchmarks are triggered manually via workflow_dispatch
+- **Configurable Suites**: Select which benchmark suite to run ("all", "performance_benchmarks", or "process_collector_benchmarks")
+- **Regression Detection**: Tests detect performance regressions and log warnings for review
 - **Baseline Comparison**: Benchmark results are cached and compared against baseline from the main branch
-- **Load Testing**: Automated load tests validate system behavior under stress
-- **Results Archival**: Benchmark results are uploaded as artifacts with 30-day retention
-
-Developers can access benchmark results from the GitHub Actions workflow artifacts. If a performance regression exceeds the 10% threshold, the CI build will fail with a detailed error message showing which benchmarks regressed.
+- **Load Testing**: Automated load tests validate system behavior under stress in a separate job
+- **Results Archival**: Benchmark and load test results are uploaded as artifacts with 30-day retention
+
+Developers can access benchmark results from the GitHub Actions workflow artifacts. Performance regressions are logged as warnings but do not fail the build, allowing for manual review and assessment.
 
 ### Load Testing
 
@@ -664,9 +665,13 @@
 
 ## Continuous Integration
 
-### GitHub Actions Workflow
-
-The CI pipeline includes multiple jobs that run on every build:
+### GitHub Actions Workflows
+
+DaemonEye uses two separate GitHub Actions workflows for testing:
+
+#### Main CI Workflow (`.github/workflows/ci.yml`)
+
+The main CI pipeline runs on every push and pull request:
 
 ```yaml
 name: Tests
@@ -750,10 +755,32 @@
           files: lcov.info
           fail_ci_if_error: false
           token: ${{ secrets.CODECOV_TOKEN }}
-
+```
+
+#### Benchmarks Workflow (`.github/workflows/benchmarks.yml`)
+
+The benchmarks workflow is triggered manually and runs independently:
+
+```yaml
+name: Benchmarks
+
+on:
+  workflow_dispatch:
+    inputs:
+      suite:
+        description: "Benchmark suite to run"
+        required: false
+        default: "all"
+        type: choice
+        options:
+          - all
+          - performance_benchmarks
+          - process_collector_benchmarks
+
+jobs:
   benchmarks:
     runs-on: ubuntu-latest
-    needs: test
+    timeout-minutes: 15
     steps:
       - uses: actions/checkout@v6
         with:
@@ -772,22 +799,20 @@
           key: criterion-baseline-${{ runner.os }}
 
       - name: Run benchmarks
-        run: mise x -- cargo bench --package procmond 2>&1 | tee 
-          bench-output.txt
+        env:
+          BENCH_SUITE: ${{ inputs.suite }}
+        run: |
+          if [ "$BENCH_SUITE" = "all" ]; then
+            mise x -- cargo bench --package procmond 2>&1 | tee bench-output.txt
+          else
+            mise x -- cargo bench --package procmond --bench "$BENCH_SUITE" 2>&1 | tee bench-output.txt
+          fi
 
       - name: Check for performance regression
         run: |
-          # Criterion reports "regressed" when performance degrades beyond noise threshold.
-          # Fail CI if any benchmark regresses more than 10%.
           if grep -q "Performance has regressed" bench-output.txt; then
             echo "::warning::Performance regression detected in benchmarks"
             grep -A2 "Performance has regressed" bench-output.txt
-            if grep -oP 'change: \+\K[0-9.]+' bench-output.txt | awk '{if ($1 > 10.0) exit 1}'; then
-              echo "All regressions within 10% threshold"
-            else
-              echo "::error::Benchmark regression exceeds 10% threshold"
-              exit 1
-            fi
           else
             echo "No performance regressions detected"
           fi
@@ -799,40 +824,64 @@
           path: target/criterion
           key: criterion-baseline-${{ runner.os }}
 
+      - name: Upload benchmark results
+        uses: actions/upload-artifact@v4
+        if: always()
+        with:
+          name: benchmark-results
+          path: bench-output.txt
+          retention-days: 30
+
+  load-tests:
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    steps:
+      - uses: actions/checkout@v6
+
+      - uses: jdx/mise-action@v3
+        with:
+          install: true
+          cache: true
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: Run load tests
         run: NO_COLOR=1 TERM=dumb mise x -- cargo test --package procmond --test
           load_tests -- --ignored --nocapture 2>&1 | tee load-test-output.txt
 
-      - name: Upload benchmark results
+      - name: Upload load test results
         uses: actions/upload-artifact@v4
         if: always()
         with:
-          name: benchmark-results
-          path: |
-            bench-output.txt
-            load-test-output.txt
+          name: load-test-results
+          path: load-test-output.txt
           retention-days: 30
 ```
 
 ### CI Jobs Overview
 
-The CI pipeline includes the following jobs:
+The main CI pipeline includes the following jobs:
 
 1. **quality**: Runs code formatting and linting checks
 2. **test**: Executes the full test suite with all features enabled
 3. **test-cross-platform**: Tests on Ubuntu, macOS, and Windows
 4. **coverage**: Generates and uploads code coverage reports
-5. **benchmarks**: Runs performance benchmarks with regression detection
+
+The benchmarks workflow includes two independent jobs:
+
+1. **benchmarks**: Runs performance benchmarks with configurable suite selection (15-minute timeout)
+2. **load-tests**: Runs load tests under stress conditions (10-minute timeout)
 
 ### Accessing Benchmark Results
 
-Benchmark results are available in multiple ways:
-
-- **Workflow Artifacts**: Download `benchmark-results` artifacts from the GitHub Actions workflow summary page
-- **CI Logs**: View benchmark output directly in the workflow logs under the "Run benchmarks" step
-- **Performance Alerts**: If a regression exceeds 10%, the CI build will fail with a warning annotation showing which benchmarks regressed
-
-The `benchmarks` job stores baseline results from the `main` branch and compares all subsequent runs against this baseline to detect performance regressions.
+Benchmark results are available through the dedicated benchmarks workflow:
+
+- **Manual Trigger**: Navigate to the Actions tab and select the "Benchmarks" workflow, then choose "Run workflow" to trigger manually
+- **Suite Selection**: Choose which benchmark suite to run: "all" (default), "performance_benchmarks", or "process_collector_benchmarks"
+- **Workflow Artifacts**: Download `benchmark-results` and `load-test-results` artifacts from the workflow summary page
+- **CI Logs**: View benchmark output directly in the workflow logs
+- **Performance Alerts**: Regressions are logged as warnings for manual review without failing the workflow
+
+The benchmarks workflow stores baseline results from the `main` branch and compares all subsequent runs against this baseline to detect performance regressions.
 
 ### Test Reporting
 

✅ Accepted

Testing Standards and Tooling
View Suggested Changes
@@ -112,18 +112,23 @@
 
 ### Automated Performance Benchmarking
 
-Performance validation is automated through a dedicated `benchmarks` job in the CI pipeline. This job runs on every CI execution to ensure performance regressions are caught early.
+Performance validation is available through a dedicated `.github/workflows/benchmarks.yml` workflow. This workflow is triggered manually via `workflow_dispatch`, allowing developers to run benchmarks on-demand rather than on every commit.
 
-The benchmarking infrastructure:
+The benchmarking infrastructure consists of two separate jobs:
 
-- Runs Criterion-based performance benchmarks for critical paths (e.g., `procmond` benchmarks)
+**Benchmarks job:**
+- Runs Criterion-based performance benchmarks for the `procmond` package
+- Supports running all benchmarks or specific benchmark suites (e.g., `performance_benchmarks`, `process_collector_benchmarks`)
 - Compares results against cached baseline measurements from the main branch
-- Detects performance regressions using a 10% threshold—builds fail if any benchmark degrades by more than 10%
+- Detects performance regressions and logs them as warnings (does not fail the build)
 - Caches baseline results between runs for accurate comparison over time
-- Executes load tests to validate system behavior under stress
-- Uploads benchmark and load test results as CI artifacts (retained for 30 days)
+- Uploads benchmark results as CI artifacts (retained for 30 days)
 
-Developers can expect automated performance validation on every pull request and commit, with clear warnings when regressions are detected. Baseline benchmarks are updated automatically when changes are merged to the main branch, ensuring comparisons remain accurate as the codebase evolves.
+**Load tests job:**
+- Runs load tests independently to validate system behavior under stress
+- Uploads load test results as separate CI artifacts (retained for 30 days)
+
+Baseline benchmarks are updated when benchmarks run on the main branch, ensuring comparisons remain accurate as the codebase evolves. Developers can manually trigger the workflow to validate performance before merging changes.
 
 ### References
 

✅ Accepted

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?  Join Discord

Copy link

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

Refactors CI/benchmarking and Windows privilege handling in procmond, primarily by moving benchmark/load-test execution into a dedicated GitHub Actions workflow and simplifying benchmark suites while keeping the workspace unsafe-free on Windows builds.

Changes:

  • Moved benchmarks + load tests out of the main CI workflow into a new .github/workflows/benchmarks.yml.
  • Simplified and sped up procmond Criterion benchmark suites by reducing measurement times and removing load-simulation scenarios.
  • Stubbed Windows privilege detection to avoid unsafe Win32 token inspection until an external safe wrapper crate is available.

Reviewed changes

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

Show a summary per file
File Description
procmond/src/security.rs Removes Win32 token privilege checks and stubs Windows security context detection.
procmond/benches/process_collector_benchmarks.rs Removes artificial delay/load benchmark and trims benchmark scale parameters.
procmond/benches/performance_benchmarks.rs Reduces measurement times and trims batch/event count ranges for faster runs.
mise.toml Updates pinned tool versions used by mise.
mise.lock Regenerates the mise lockfile to match updated tool versions.
justfile Adds a bench-procmond convenience recipe.
.github/workflows/ci.yml Removes the benchmarks/load-tests job from main CI.
.github/workflows/benchmarks.yml Adds a dedicated workflow to run benchmarks and load tests.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 9, 2026
Copilot AI review requested due to automatic review settings March 9, 2026 01:38
@unclesp1d3r unclesp1d3r review requested due to automatic review settings March 9, 2026 01:38
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 9, 2026
@coderabbitai coderabbitai bot added documentation Improvements or additions to documentation size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 9, 2026
@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2026

🧪 CI Insights

Here's what we observed from your CI run for facb138.

🟢 All jobs passed!

But CI Insights is watching 👀

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…e checks

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
feat(benches): implement system-level performance benchmarks for process collection and RPC
fix(security): update Windows privilege detection documentation and tracking issue

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Copilot AI review requested due to automatic review settings March 9, 2026 02:02
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 9, 2026
@coderabbitai coderabbitai bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Mar 9, 2026
Copy link

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

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

- **Suite Selection**: Choose which benchmark suite to run: "all" (default), "performance_benchmarks", or "process_collector_benchmarks"
- **Workflow Artifacts**: Download `benchmark-results` and `load-test-results` artifacts from the workflow summary page
- **CI Logs**: View benchmark output directly in the workflow logs
- **Performance Alerts**: Regressions are logged as warnings for manual review without failing the workflow
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The docs say benchmark regressions are "logged as warnings but do not fail the build/workflow", but the actual .github/workflows/benchmarks.yml step exits non-zero when regressions exceed the threshold (currently 20%). Update the documentation to reflect the current behavior (or adjust the workflow to match the documented non-failing behavior), otherwise this will surprise people relying on the docs.

Suggested change
- **Performance Alerts**: Regressions are logged as warnings for manual review without failing the workflow
- **Performance Alerts**: Significant regressions (currently >20% slowdown versus the `main` baseline) cause the benchmarks job to fail, while smaller regressions are logged as warnings for manual review

Copilot uses AI. Check for mistakes.
let _ = unsafe { windows::Win32::Foundation::CloseHandle(token_handle) };

info.is_ok() && elevation.TokenIsElevated != 0
warn!("Windows privilege detection not yet implemented; running in degraded mode");
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

detect_privileges() already logs a warning when ctx.degraded_mode is true. With the new Windows stub, detect_windows_privileges() also emits a warning, so Windows will log two warnings every time privilege detection runs. Consider downgrading the Windows-specific message to debug!/info!, or removing it and relying on the outer degraded-mode warning (optionally adding a capability note like "windows_privileges_unimplemented" for visibility).

Suggested change
warn!("Windows privilege detection not yet implemented; running in degraded mode");
info!("Windows privilege detection not yet implemented; running in degraded mode");

Copilot uses AI. Check for mistakes.
Comment on lines +217 to +227
let initial_file_count = std::fs::read_dir(temp_dir.path())
.map(|entries| {
entries
.filter_map(|e| e.ok())
.filter(|e| e.path().extension().is_some_and(|ext| ext == "wal"))
.count()
})
.unwrap_or_else(|_err| {
eprintln!("WARNING: Could not measure memory for current process");
0
});
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The fallback warning message here says "Could not measure memory for current process", but this code path is handling a failure to read the temp directory to count .wal files. This looks like a copy/paste and makes benchmark output misleading; update the message to reflect the actual operation (e.g., failed to read WAL directory / count WAL files).

Copilot uses AI. Check for mistakes.
Comment on lines +764 to +778
```yaml
name: Benchmarks

on:
workflow_dispatch:
inputs:
suite:
description: "Benchmark suite to run"
required: false
default: "all"
type: choice
options:
- all
- performance_benchmarks
- process_collector_benchmarks
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The benchmarking workflow example in the docs still lists performance_benchmarks as a selectable suite, but that bench was removed and the actual workflow input options are now wal_benchmarks, eventbus_benchmarks, serialization_benchmarks, system_benchmarks, and process_collector_benchmarks. Please update the options list (and any surrounding text) to match the real .github/workflows/benchmarks.yml input choices so readers can run the documented suites successfully.

Copilot uses AI. Check for mistakes.
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 9, 2026
Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 9, 2026
@coderabbitai coderabbitai bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Mar 9, 2026
@unclesp1d3r unclesp1d3r enabled auto-merge (squash) March 9, 2026 02:40
@unclesp1d3r unclesp1d3r merged commit f48f99e into main Mar 9, 2026
15 checks passed
@unclesp1d3r unclesp1d3r deleted the fix/ci-benchmarks-and-windows-build branch March 9, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Configuration management and settings dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation integration Related to integration testing and component integration procmond Issues related to the process monitoring daemon size:XL This PR changes 500-999 lines, ignoring generated files. size:XXL This PR changes 1000+ lines, ignoring generated files. testing Related to test development and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants