This document is intended for CX Framework and BenchKit developers. It collects structural and operational details that are too implementation-focused for the top-level README.
benchkit/
|- programs/
| `- <code>/
| |- build.sh
| |- run.sh
| |- estimate.sh
| `- list.csv
|- benchpark-bridge/
| |- config/
| `- scripts/
|- result_server/
| |- routes/
| |- templates/
| |- utils/
| |- tests/
| |- app.py
| |- app_dev.py
| `- create_admin.py
|- scripts/
| |- result_server/
| `- estimation/
|- config/
|- docs/
| |- cx/
| `- guides/
`- .gitlab-ci.yml
programs/<code>/App-specific build, run, and estimation entry points.benchpark-bridge/BenchPark integration and conversion support.result_server/Flask-based result portal, ingest API, authentication, admin pages, and tests.scripts/Shared CI helpers, result shaping, estimation helpers, and portal upload scripts.config/System, queue, and hardware metadata.docs/Specifications and operational guides.
result_server/ provides:
- ingest APIs for results, estimates, profiler archives, and estimation inputs
- public and confidential result views
- detailed result and estimate pages
- usage reporting
- TOTP-based authentication
- admin pages for user management
result_server/routes/results.pyResult-related blueprint registration.result_server/routes/results_list_routes.pyPublic and confidential result list pages.result_server/routes/results_detail_routes.pyResult detail, compare, downloads, and related views.result_server/routes/results_usage_routes.pyUsage reporting pages.result_server/routes/estimated.pyEstimated-result blueprint registration.result_server/routes/estimated_list_routes.pyEstimated-result list pages.result_server/routes/estimated_detail_routes.pyEstimated-result detail and downloads.result_server/routes/api.pyIngest and query APIs.result_server/routes/auth.pyLogin, setup, logout, and TOTP flow.result_server/routes/admin.pyAdmin-only user management.
result_server/templates/_results_base.htmlShared shell for portal pages.result_server/templates/_table_base.htmlShared table page base.result_server/templates/results.htmlResult list page.result_server/templates/result_detail.htmlResult detail page.result_server/templates/result_compare.htmlResult comparison page.result_server/templates/estimated_results.htmlEstimated-result list page.result_server/templates/estimated_detail.htmlEstimated-result detail page.result_server/templates/usage_report.htmlUsage report page.result_server/templates/systemlist.htmlSystem list page.result_server/templates/auth_login.htmlLogin page.result_server/templates/auth_setup.htmlTOTP setup page.result_server/templates/admin_users.htmlAdmin user management page.
- Reads
programs/<code>/list.csv,config/system.csv, andconfig/queue.csv - Generates
.gitlab-ci.generated.ymlwithscripts/matrix_generate.sh - Supports both cross-build and native execution modes
- Enables or disables jobs based on
list.csv
buildrunsend_results
build_runsend_results
build.shandrun.share the primary application entry points.run.shreceivessystem,nodes,numproc_node, andnthreads.scripts/bk_functions.shprovides shared emit helpers such as result, section, and overlap output.record_timestamp.sh,collect_timing.sh, andresult.shshape timing and result JSON data before upload.
scripts/result_server/send_results.shUploads result JSON and profiler archives.scripts/result_server/send_estimate.shUploads estimated-result JSON.scripts/result_server/fetch_result_by_uuid.shFetches uploaded result data by UUID.
- App-specific estimation logic lives in
programs/<code>/estimate.sh. - Shared helpers live under
scripts/estimation/. - Re-estimation uses result UUIDs as the main input contract.
- BenchPark-specific conversion and bridge logic lives under
benchpark-bridge/. - BenchPark CI can adapt BenchPark-native outputs into the ingest schema used by the result server.
config/system.csvSystem execution configuration.config/queue.csvQueue configuration.config/system_info.csvHardware and display metadata for the portal.programs/<code>/list.csvApp-specific execution matrix.
BenchKit uses GitHub for source hosting and GitLab CI for benchmark execution.
To avoid unnecessary benchmark execution, the pipeline skips jobs when changes are limited to:
*.mdresult_server/**/*
These rules are defined in .gitlab-ci.yml.
Commit-message and variable-driven controls remain available for benchmark and BenchPark workflows. Refer to .gitlab-ci.yml and benchpark-bridge/scripts/ci_generator.sh for the active control points.
Execution environments are controlled by:
config/system.csvconfig/queue.csv- per-app
list.csv - app-specific
build.shandrun.sh
Each system can define queue group, build mode, run mode, node count, and related scheduler settings.
Typical requirements include:
- Bash and standard shell tooling
- GitLab CI runner support
- site-specific scheduler/runtime support
- Python for result shaping, estimation support, and portal components
- Flask-related Python packages for
result_server - optional profiler tools depending on system support
For local portal work, see the route, template, and utility layout under result_server/.
For the lightweight result_server verification path:
- install dependencies with
python -m pip install -r requirements-result-server.txt - run the portal test suite with
python scripts/test_result_server.py - CI coverage for portal-only changes is provided by
.github/workflows/result-server-tests.yml
BenchKit currently keeps result-quality validation visibility-first.
- run
python scripts/validate_result_quality.py <result-dir-or-json> - use
--format jsonfor machine-readable output - use
--fail-on warningor--fail-on candidateonly when you explicitly want non-zero exit behavior
This validator is intended as a lightweight pre-CI gate and a future stepping stone toward stricter result validation.
Internally, the validator can also read config/result_quality_policy.json to assign app-specific tiers such as strict, standard, and relaxed.
This policy is currently intended for internal operation, and it does not need to be reflected in public UI or external contracts.
If you want to manage tier overrides locally without editing the JSON file, the validator can also read a Redis hash.
- set
BK_RESULT_QUALITY_REDIS_URL=redis://localhost:6379/0 - optionally set
BK_RESULT_QUALITY_REDIS_KEY=benchkit:result_quality:app_tiers - store entries such as
qws -> strictorgenesis -> relaxedin that hash
Redis overrides are merged on top of config/result_quality_policy.json and are intended for internal/local control only.
scripts/result_server/send_results.sh can invoke the validator before upload.
- set
BK_RESULT_QUALITY_VALIDATE=trueto enable the pre-upload validator - leave
BK_RESULT_QUALITY_FAIL_ON=nonefor report-only execution - use
BK_RESULT_QUALITY_FAIL_ON=warningorBK_RESULT_QUALITY_FAIL_ON=candidateonly when you intentionally want upload-time failure behavior - use
BK_RESULT_QUALITY_FAIL_ON=policyonly for internal experiments with app-specific quality tiers
Recommended rollout:
- phase 1:
BK_RESULT_QUALITY_VALIDATE=true,BK_RESULT_QUALITY_FAIL_ON=none - phase 2: keep CI/report-only, but review repeated validator candidates in usage reports
- phase 3: promote a small subset of stable rules to
candidate-based failure
If you experiment with app-specific tiers, prefer starting with --fail-on policy only in private or staging-like internal workflows.