Skip to content

feat(bernese): USER.CPU maxjobs sizing + V_CLUFIN/V_CLU plumbing (RH-006) - #43

Merged
alfieprojectsdev merged 1 commit into
docs/bernese-training-notesfrom
feat/rh-006-clustering
Jul 2, 2026
Merged

feat(bernese): USER.CPU maxjobs sizing + V_CLUFIN/V_CLU plumbing (RH-006)#43
alfieprojectsdev merged 1 commit into
docs/bernese-training-notesfrom
feat/rh-006-clustering

Conversation

@alfieprojectsdev

Copy link
Copy Markdown
Owner

RH-006 (plumbing) — USER.CPU maxjobs sizing + V_CLUFIN/V_CLU (gap #13)

Stacked on #38; base retargets to main once #38 merges. Ships the orchestrator plumbing for the biggest R740 lever; the empirical clustering value is an R740 tuning task (see below).

Problem

Every daily run spent ~40 min of ~2 h in PID 502 GPSCLU_P — a single-core GPSEST at 99% CPU. Cause: V_CLUFIN=A auto-clustering collapsed the whole network into one dense normal-equation inversion, unparallelized. On the R740 this is the single highest-value tuning win; without it, 270 stations/day is infeasible.

Change (plumbing)

  • cpu_config.compute_maxjobs(physical_cores, ram_gb=…, reserve_cores=…) (task L) — maxjobs from physical cores, not logical CPUs (sub-solves are FPU-bound; hyperthreads sharing an FPU don't help), RAM-capped (floor(ram_gb / ram_per_job_gb)) and reserve-aware.
  • cpu_config.set_user_cpu_maxjobs(text, n) — rewrites the localhost maxjobs field in USER.CPU, leaving command/speed/other CPU rows/MSG lines intact.
  • PCFContext now exposes v_clu (default 10) and v_clufin (default "A"); the template templates both — V_CLUFIN was absent from the template entirely.

Correction to the readiness doc

The real PCF shows V_CLUFIN is a mode flag (A auto / N skip), not a cluster-size number as the readiness doc implied. A produced the one-giant-cluster solve. The orchestrator can now inject a chosen V_CLUFIN + a core-sized maxjobs, but the value that actually parallelizes the final solve is empirical and needs the R740's core count + real timing (BRN-001, not installed). So RH-006 stays PARTIAL — mechanisms shipped, tuning value deferred.

Tests

test_cpu_config.py +13 (maxjobs cores/reserve/floor/RAM-cap/validation; set_user_cpu_maxjobs localhost-only rewrite + no-op + reject; PCFContext clustering defaults/override; template exposes the vars). 88 pass, ruff + mypy clean. Verified via the rh-004 worktree venv (no uv sync — BPE running). Worktree .trees/rh-006-clustering.

…006)

Plumbing for the 502 GPSCLU_P single-cluster bottleneck (gap #13). The
40-min single-core final solve came from V_CLUFIN=A auto-clustering the
whole network into ONE dense inversion; the fix is final-solution
clustering + USER.CPU maxjobs across cores. That win is CONFIG, and its
empirical value needs the R740 (BRN-001) — this ships the mechanisms.

- cpu_config.compute_maxjobs(): maxjobs from PHYSICAL cores (sub-solves are
  FPU-bound, hyperthreads don't help), RAM-capped and reserve-aware.
- cpu_config.set_user_cpu_maxjobs(): rewrites the localhost maxjobs field in
  USER.CPU, leaving command/speed/other CPUs/MSG lines intact.
- PCFContext exposes v_clu (10) + v_clufin ('A', a MODE flag N/A per the real
  PCF — corrected from the readiness doc's 'set to a number' framing); the
  template now templates both (V_CLUFIN was absent).

test_cpu_config.py +13. 88 pass, ruff + mypy clean. Verified via the rh-004
worktree venv (no uv sync — BPE running). Worktree .trees/rh-006-clustering.

RH-006 stays PARTIAL: the actual V_CLUFIN split value is an R740 tuning task.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 100bfef5-906d-49a3-b95b-167cd93ef590

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rh-006-clustering

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@alfieprojectsdev
alfieprojectsdev merged commit 000f30f into docs/bernese-training-notes Jul 2, 2026
1 check 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.

1 participant