Skip to content

workerpoh: log effective gpu-chunk / search-timeout-ms in the startup searcher line - #16

Merged
jokeez merged 1 commit into
jokeez:mainfrom
bobbyning:pr16/searcher-log-effective-chunk
Sep 25, 2026
Merged

jokeez merged 1 commit into
jokeez:mainfrom
bobbyning:pr16/searcher-log-effective-chunk

Conversation

@bobbyning

@bobbyning bobbyning commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The startup line is the first thing a miner reads when tuning GPU parameters:

workerpoh: searcher=cpu mode=cpu backend= hybrid_sign=true

It does not show which -gpu-chunk / -search-timeout-ms values are actually in effect. Since #14 the defaults can come from GPU_CHUNK / SEARCH_TIMEOUT_MS envs, but a misconfigured or ignored value is still invisible: the line looks identical whether tuning applied or not, and per-launch overhead at small chunks can silently cap hashrate (on older GPUs the majority of batch time can be launch overhead at the 1<<22 default).

Change

Append chunk=<N> search_timeout_ms=<N> to the startup line, in both cpu and gpu modes:

workerpoh: searcher=cpu mode=cpu backend= hybrid_sign=false chunk=4194304 search_timeout_ms=2500

One Fprintf change; behavior otherwise unchanged. Consumers of the line are humans plus archived example logs (docs/archive/vast/*), which append-only fields do not affect; no test or script parses it.

Testing

  • go vet ./cmd/workerpoh/, full package tests, and build — clean (on top of merged workerpoh: honor GPU_CHUNK / SEARCH_TIMEOUT_MS envs for node-spawned workers #14).
  • Smoke runs against a non-listening loopback coord:
    • no env → chunk=4194304 search_timeout_ms=2500
    • GPU_CHUNK=999424 SEARCH_TIMEOUT_MS=777 → chunk=999424 search_timeout_ms=777
    • GPU_CHUNK=999424 + explicit -gpu-chunk 3145728 → chunk=3145728 (flag precedence visible)
  • Notes: the line prints the configured value; the GPU claim loop's safety floor (max(chunk, 1024)) is applied at use time, so a sub-1024 configured chunk prints as configured. In cpu mode chunk is configured-but-unused, consistent with backend= being informational there.

Summary by CodeRabbit

  • Chores
    • Startup logs now display the configured GPU chunk size and per-chunk search timeout in milliseconds, making these settings easier to check when reviewing application startup information. No changes to search behavior or user-facing functionality are included in this update.

The startup searcher line (workerpoh: searcher=... mode=... backend=...
hybrid_sign=...) is the first thing a miner reads when tuning GPU
parameters, but it does not show which -gpu-chunk / -search-timeout-ms
are actually in effect. When tuning comes from env defaults or rig
profiles instead of explicit flags, a misconfigured value is invisible:
the line looks identical whether tuning applied or not, and per-launch
overhead at small chunks silently caps hashrate.

Append chunk=<N> search_timeout_ms=<N> to the startup line so the
effective values are visible immediately, in both cpu and gpu modes.
One Fprintf change; behavior otherwise unchanged.

Verified: go vet, full package tests, build, and smoke runs (cpu mode)
print the new fields; combined with the GPU_CHUNK env-default fix the
line reflects env-provided values.
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: jokeez/hackme/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 18df008f-1c4d-48fe-8fd1-2b9bb198507a

📥 Commits

Reviewing files that changed from the base of the PR and between e97c177 and 35a7f71.

📒 Files selected for processing (1)
  • cmd/workerpoh/main.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The startup searcher log now reports the configured GPU chunk size and per-chunk search timeout in milliseconds.

Changes

Searcher startup logging

Layer / File(s) Summary
Report search configuration
cmd/workerpoh/main.go
The startup searcher log includes GPU chunk size and search timeout alongside the existing searcher, mode, backend, and hybrid-signing status.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Feature

Suggested reviewers: jokeez

Merge Risk: ⚪ Minimal · up to 35a7f

The startup line makes configured search settings visible; no merge-blocking issue is indicated.

Architecture Summary

Architecture risk: 🔵 Low · up to 35a7f

The change affects 1 system.

Changed systems: cmd

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — cmd (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in cmd/workerpoh/main.go: The startup searcher log now reports the GPU chunk size and search timeout alongside the searcher, mode, backend, and hybrid-signing status.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: logging the effective GPU chunk and search timeout in the workerpoh startup searcher line.
Description check ✅ Passed The description explains the problem, the change, behavior details, and test results. It uses equivalent Problem, Change, and Testing sections instead of the template headings and omits the Notes sect…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Log effective GPU tuning values at worker startup

✨ Enhancement 🕐 Less than 5 minutes

Grey Divider

AI Description

• Expose effective GPU chunk size and search timeout in the startup log.
• Improve CPU and GPU tuning visibility without changing worker behavior.
High-Level Assessment

Appending the effective values to the existing human-readable startup line is the optimal low-risk approach. Structured logging or additional diagnostics would add unnecessary complexity for two informational fields and could disrupt the current log format more significantly.

Files changed (1) +2 / -2

Enhancement (1) +2 / -2
main.goInclude effective tuning values in the startup searcher log +2/-2

Include effective tuning values in the startup searcher log

• Extends the worker startup line with the resolved GPU chunk size and search timeout. This makes flag and environment-derived tuning values visible in both CPU and GPU modes without changing search behavior.

cmd/workerpoh/main.go

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@jokeez jokeez left a comment

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.

LGTM — small, useful follow-up to #14 so effective GPU_CHUNK / SEARCH_TIMEOUT_MS are visible on the startup line. Thanks.

@jokeez
jokeez merged commit 5d0fedf into jokeez:main Sep 25, 2026
6 checks passed
@jokeez

jokeez commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Merged — thanks @bobbyning.

Nice follow-up to #14: the startup line now shows the chunk / search_timeout_ms that are actually in effect (including env defaults and flag precedence), so silent misconfig is harder to miss when tuning the 4090 path.

CI was green; squash is on main. Pull with rc17.2 / main tip when you upgrade the fleet.

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