Skip to content

kottofy/CPUCoreProbe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPUCoreProbe (Windows + PowerShell)

Automate JetStream 2 runs while pinning Chrome to one logical CPU at a time.

This project is useful for comparing per-core performance (or per-thread behavior) on a Windows system.

Why This Project Exists

This started as a troubleshooting tool for recurring Chromium-based browser crashes with the error STATUS_ACCESS_VIOLATION.

Pinning each benchmark run to one logical CPU and logging results per core makes it easier to spot core-specific patterns, such as repeat crashes or unusual slowdowns, and can help identify a potentially faulty CPU core rather than a broader browser or system issue.

What It Does

  • Launches Chrome through Selenium for each CPU index.
  • Pins Chrome processes to a single logical CPU using processor affinity.
  • Clicks JetStream's Start Test button automatically.
  • Waits for the benchmark result.
  • Writes completed benchmark scores to cpucoreprobe-scores.csv.
  • Writes failed/cancelled runs and diagnostics to cpucoreprobe-errors.csv.
  • Handles Ctrl+C gracefully and records cancellation status.

Repository Layout

  • cpucoreprobe.ps1 - thin launcher script (CLI entry point).
  • src/CPUCoreProbe/CPUCoreProbe.psm1 - module loader and export surface.
  • src/CPUCoreProbe/Public/Start-CPUCoreProbeRun.ps1 - orchestration entry function.
  • src/CPUCoreProbe/Private/*.ps1 - internal helpers (config, browser, diagnostics, control flow).
  • cpucoreprobe.config.json - runtime defaults (CPU range, timeouts, URL, Chrome args/paths).
  • cpucoreprobe-scores.csv - completed run scores output file (created/appended automatically).
  • cpucoreprobe-errors.csv - failed/cancelled run diagnostics output file (created/appended automatically).
  • tools/chromedriver/.../chromedriver.exe - bundled ChromeDriver location.

Requirements

  • Windows
  • PowerShell 5.1+ (works from Windows PowerShell)
  • Google Chrome installed
  • ChromeDriver major version matching installed Chrome major version
  • Selenium PowerShell module

Install Selenium module (current user):

Install-Module Selenium -Scope CurrentUser

Quick Start

From the repo root (C:\src\CPUCoreProbe):

.\cpucoreprobe.ps1

To test only one CPU index from the terminal, pass the parameter flag:

.\cpucoreprobe.ps1 -CpuIndex 8

To test an explicit CPU range from the terminal, pass start/end parameters:

.\cpucoreprobe.ps1 -StartCpuIndex 0 -EndCpuIndex 31

The script will:

  1. Validate Selenium, Chrome, and ChromeDriver.
  2. Load runtime defaults from cpucoreprobe.config.json.
  3. Iterate CPU indexes in the configured range ($cpuStartIndex to $cpuEndIndex).
  4. Run JetStream once per CPU index.
  5. Append completed scores to output.scoresCsvPath and failures/diagnostics to output.errorsCsvPath.

Runtime Configuration

The script reads cpucoreprobe.config.json from the repository root.

Configurable values:

  • benchmark.url
  • benchmark.buttonTimeoutSec
  • benchmark.resultTimeoutSec
  • benchmark.postNavigationDelaySec
  • benchmark.pollIntervalSec
  • benchmark.betweenRunsDelaySec
  • cpu.defaultStartIndex
  • cpu.defaultEndIndex
  • chrome.driverSearchRoot
  • chrome.paths
  • chrome.arguments
  • output.scoresCsvPath
  • output.errorsCsvPath
  • runtime.cancellationPollMs
  • runtime.chromeProcessLookbackSec
  • diagnostics.enableProcDump
  • diagnostics.procDumpPath
  • diagnostics.dumpOutputPath
  • diagnostics.dumpType
  • diagnostics.maxDumpsPerRun
  • diagnostics.firstChanceExceptions
  • diagnostics.includeBreakpoints
  • diagnostics.monitorTimeoutSec

Notes:

  • chrome.paths is evaluated in order; first existing path is used.
  • Environment variables in paths are supported (for example %LOCALAPPDATA%\\Google\\Chrome\\Application\\chrome.exe).
  • chrome.driverSearchRoot, output.scoresCsvPath, and output.errorsCsvPath can be relative to the repository root or absolute paths.
  • The config file is required; the script exits if the file is missing or invalid.
  • Default layout keeps CSV outputs in results and writes ProcDump artifacts under logs.

Integrated Crash Dumps (ProcDump)

CPUCoreProbe can automatically run ProcDump during each CPU test run and save crash dumps when Chrome crashes with unhandled exceptions.

How it works:

  1. Before each run, CPUCoreProbe starts a ProcDump monitor for chrome.exe.
  2. During the run, ProcDump captures dump files when exception triggers match.
  3. In cleanup, CPUCoreProbe stops ProcDump and records dump metadata in CSV.

Key settings:

  • diagnostics.enableProcDump: enable integrated dump capture.
  • diagnostics.procDumpPath: path to procdump.exe.
  • diagnostics.dumpOutputPath: base folder for run dump artifacts. CPUCoreProbe creates a per-script-run subfolder (run-YYYYMMDD-HHMMSS) and stores that invocation's dump/log files beneath it.
  • diagnostics.dumpType: Mini, MiniPlus, or Full.
  • diagnostics.maxDumpsPerRun: max dumps per run.
  • diagnostics.firstChanceExceptions: when true, captures first-chance exceptions (-e 1); otherwise second-chance (-e).
  • diagnostics.includeBreakpoints: when true, include debug breakpoint exceptions (-b).
  • diagnostics.exceptionFilters: include-filter strings passed to ProcDump (-f) to target specific crash exceptions.
  • diagnostics.monitorTimeoutSec: max wait on monitor shutdown during cleanup.

Notes:

  • ProcDump capture is best-effort. If ProcDump cannot start or attach, benchmark runs still continue and the reason is written to CSV diagnostics fields.
  • Default config keeps ProcDump disabled (diagnostics.enableProcDump=false) until you opt in.
  • Keep runs isolated from personal browsing, because cleanup logic can terminate recently-started Chrome processes.

Configure CPU Range

CPU range can be configured in two ways:

  • Default values in cpucoreprobe.config.json (cpu.defaultStartIndex and cpu.defaultEndIndex).
  • Runtime parameters: -StartCpuIndex <n> -EndCpuIndex <m>.

How it works:

  • The range is inclusive, so 0 and 31 runs CPUs 0..31.
  • Set 8 and 15 to test only CPUs 8..15.
  • Use -CpuIndex <n> when launching the script to run only CPU <n>.
  • -CpuIndex and range parameters are separate parameter sets; combining them fails during parameter binding.
  • cpuStartIndex must be >= 0.
  • cpuEndIndex must be >= cpuStartIndex.
  • cpuEndIndex must be less than your machine's logical CPU count.

If values are invalid, the script exits early with a clear error message.

Output Format

cpucoreprobe-scores.csv rows include:

  • Timestamp
  • CpuIndex
  • Score
  • Status

cpucoreprobe-errors.csv rows include:

  • Timestamp
  • CpuIndex
  • Status
  • ErrorCode
  • ErrorMessage
  • DumpCaptureStatus
  • DumpCount
  • DumpFiles
  • DumpRunPath
  • DumpType
  • DumpLogPath
  • DumpMonitorMessage

Notes:

  • cpucoreprobe-scores.csv receives completed runs with a captured numeric score.
  • Status is one of Completed, Failed, or Cancelled.
  • cpucoreprobe-errors.csv receives non-completed runs, including ErrorCode and diagnostic columns.
  • DumpCaptureStatus is Disabled, Captured, NoDump, or an error status such as ToolMissing/StartFailed.
  • The script does not create per-run profile folders under the repository.

Notes About Affinity

  • Affinity mask is computed with 1L -shl $i.
  • The script targets the inclusive range defined by $cpuStartIndex and $cpuEndIndex.

ChromeDriver Resolution Order

The script looks for ChromeDriver in this order:

  1. Bundled driver under tools\chromedriver\...\chromedriver.exe (recursive search).
  2. chromedriver.exe available on PATH.

If Chrome major version and ChromeDriver major version do not match, the script exits with an error.

Security Considerations

This script is local automation, but there are still security risks to be aware of:

  • Browser state and local data:

    • Chrome may still use normal browser storage/state while automation runs.
    • Mitigation: run benchmarks on a dedicated test account or machine when investigating crashes.
  • Third-party dependency trust:

    • The script executes chromedriver.exe and the Selenium module. A tampered binary/module could execute arbitrary code as your user.
    • Mitigation: only use trusted ChromeDriver builds, pin versions where possible, and keep dependencies updated.
  • Process control side effects:

    • Cleanup logic kills recently started Chrome processes. On a shared machine or during parallel Chrome usage, this may terminate unrelated sessions.
    • Mitigation: run in a dedicated test environment and avoid personal browsing during test runs.
  • Remote content execution risk:

    • The benchmark page is loaded from https://browserbench.org/JetStream/. If the source is compromised, malicious page content could run in the browser context.
    • Mitigation: run only against trusted HTTPS targets and keep Chrome patched.

General guidance:

  • Run this script as a standard user (not elevated) unless admin rights are explicitly required.
  • Prefer isolated test machines/VMs for repeated crash investigation.
  • Review script changes before running updates from external sources.

Troubleshooting

  • Selenium PowerShell module is not installed

    • Run: Install-Module Selenium -Scope CurrentUser
  • Chrome executable not found

    • Install Google Chrome, or edit chrome.paths in cpucoreprobe.config.json.
  • Chrome/ChromeDriver mismatch

    • Install a ChromeDriver build matching your Chrome major version.
  • Start button not found/clickable

    • JetStream page layout may have changed. Update selectors in Invoke-StartTestClick.
  • Result not detected within ... seconds

    • Run may have stalled, network may be unstable, or selectors in Get-ResultText may need updates.
  • ProcDump executable not found

    • Install ProcDump and set diagnostics.procDumpPath to a valid procdump.exe path.
  • ProcDump monitor unavailable

    • Check DumpCaptureStatus, DumpMonitorMessage, and DumpLogPath columns in CSV for failure details.

Repro Tips

  • Close heavy background apps before testing.
  • Keep power plan consistent (for example, High performance).
  • Run multiple passes and compare medians, not single runs.
  • Avoid interacting with the machine during benchmark execution.

License

Add a license file if you plan to share or accept contributions publicly.

About

A PowerShell automation tool for diagnosing per‑core CPU stability. CPUCoreProbe runs JetStream 2 under single‑core affinity, logs performance scores and failures, and optionally captures ProcDump crash artifacts to pinpoint faulty or unstable CPU cores.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors