Ob upgrade to fastchess#8
Open
Menkib64 wants to merge 98 commits into
Open
Conversation
Rejects fixed move time, fischer, and cyclic time controls. Also rejects any game with VERBOSE PGN reporting, as those results may be tainted as well.
Co-authored-by: Andrew Grant <andrew.github@grantnet.us>
Safari on mobile automatically formats Unix time stamp to links to phone numbers. E.g. 1746223790 to <a href="tel:1746223790">1746223790</a>. Since innerHTML returns the entire HTML content contained within the element, this breaks the date calculation code. Using textContent, which ignores html tags, fixes this issue.
…ting API requests (AndyGrant#340)
There was a problem hiding this comment.
Pull request overview
This PR merges upstream OpenBench changes while adapting the codebase for a fastchess-based workflow. It introduces new workload/UI behavior (dynamic results + “info” fields), refactors SPSA handling into database models + APIs, and removes legacy artifact-watching / older client assumptions, with accompanying migrations.
Changes:
- Switches multiple server/client paths from Cutechess-era assumptions to fastchess-era behavior (new config keys, new client endpoint, updated scripts).
- Refactors SPSA from JSON-on-Test to relational models (
SPSARun/SPSAParameter) with new API endpoints and UI helpers. - Updates templates to support workload “info”, dynamic results fetching, and improved search filtering/sharing.
Reviewed changes
Copilot reviewed 75 out of 80 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| UnitTests/test_pgn_util.py | Removed legacy PGN test harness. |
| UnitTests/example1.pgn | Removed test PGN fixture. |
| UnitTests/example2.pgn | Removed test PGN fixture. |
| Templates/OpenBench/workload.html | Dynamic results rendering + SPSA API copy/digest UI + info editing. |
| Templates/OpenBench/search.html | Reworked search form to GET + URL pruning + new filters/UI layout. |
| Templates/OpenBench/networks.html | Displays/sorts network scale_nps. |
| Templates/OpenBench/network.html | Allows editing network scale_nps. |
| Templates/OpenBench/machine.html | Shows fastchess version + “last seen” placement. |
| Templates/OpenBench/index.html | Groups active tests by priority + layout tweaks. |
| Templates/OpenBench/create_workload.html | Adds workload “info” field + network-change hooks. |
| Templates/OpenBench/Blocks/testsummary.html | Displays test.info in list rows. |
| Templates/OpenBench/base.html | Adds per-workload title block + safer timestamp handling + engine options popup. |
| Scripts/test_pgn_processing.py | Adds PGN processing validator script using python-chess. |
| Scripts/spsa/track_spsa.py | Adds SPSA snapshot polling/logger script. |
| Scripts/spsa/graph_gamma.py | Adds SPSA gamma decay visualization script. |
| Scripts/genfens_engine.py | Adds standalone genfens invocation script. |
| Scripts/delete_networks.py | Adds authenticated API-driven network deletion script. |
| Scripts/create_test.py | Updates script payload to new workload fields/names. |
| Scripts/bench_engine.py | Updates bench invocation signature. |
| Scripts/bench_all.py | Simplifies engine preparation/build flow. |
| Scripts/archive2pgns.py | Adds multithreaded archive-to-PGN extraction + multi-archive support. |
| Scripts/archive2nps.py | Updates comment parsing + per-result aggregation + verbose reporting. |
| README.md | Updates docs to reference fastchess. |
| OpenSite/wsgi.py | Installs SIGTERM handler to ensure graceful PGN watcher shutdown. |
| OpenBench/workloads/view_workload.py | Adds result truncation + efficient values-based result extraction. |
| OpenBench/workloads/verify_workload.py | Simplifies GitHub source handling; adds “info” extraction/stripper. |
| OpenBench/workloads/modify_workload.py | Adds approve permission check + supports editing workload info. |
| OpenBench/workloads/get_workload.py | Updates workload distribution + SPSA assignment wiring + noisy-worker filtering. |
| OpenBench/workloads/create_workload.py | Adds info handling + SPSA run creation + moves branch compare helper. |
| OpenBench/watcher.py | Removes legacy artifact watcher thread. |
| OpenBench/views.py | Major updates: search logic, grouped active tests, new APIs, client versioning, results fetching. |
| OpenBench/utils.py | Adds time-based workload filter + network scale_nps edits + SPSA update path changes. |
| OpenBench/urls.py | Adds endpoints for match runner version + SPSA/workload APIs + network delete API. |
| OpenBench/templatetags/mytags.py | Switches SPSA display helpers to OpenBench.spsa_utils; adjusts git diff URL normalization. |
| OpenBench/static/workload_utils.js | Adds dynamic results population + copy/fetch helpers for SPSA/workload APIs. |
| OpenBench/static/style.css | Styles test info column + engine options hover popup + layout tweaks. |
| OpenBench/static/form.css | Enables textarea resize + workflow-edit form layout helpers. |
| OpenBench/static/create_workload.js | Adds scale updates on engine/network changes + default network handling. |
| OpenBench/static/copy_text.js | Removes old copy helper (superseded). |
| OpenBench/static/base.css | Adds .mw-15 / .mw-20 sizing helpers. |
| OpenBench/spsa_utils.py | New SPSA logic module (digest/original/assignment, run/param creation). |
| OpenBench/pgn_watcher.py | Batches PGN ingestion into tar archives; improves shutdown behavior. |
| OpenBench/models.py | Adds info, network scale_nps, SPSA relational models; removes awaiting and Test.spsa JSON. |
| OpenBench/model_utils.py | Adds model-to-dict helpers + shared network deletion logic. |
| OpenBench/migrations/0011_normalize_engine_source.py | Normalizes stored Engine.source URLs. |
| OpenBench/migrations/0010_remove_test_awaiting.py | Removes Test.awaiting field. |
| OpenBench/migrations/0009_test_info.py | Adds Test.info field migration. |
| OpenBench/migrations/0008_alter_profile_games.py | Changes Profile.games to BigInteger. |
| OpenBench/migrations/0007_remove_test_spsa.py | Removes Test.spsa JSON field migration. |
| OpenBench/migrations/0006_auto_20260126_0648.py | Data migration from Test.spsa JSON into SPSA models. |
| OpenBench/migrations/0005_remove_spsaparameter_a_end_remove_spsarun_a_value.py | Drops unused SPSA fields. |
| OpenBench/migrations/0004_spsaparameter_index.py | Adds SPSAParameter.index. |
| OpenBench/migrations/0003_alter_spsaparameter_spsa_run.py | Alters SPSAParameter relation. |
| OpenBench/migrations/0002_spsarun_spsaparameter.py | Adds initial SPSA models migration. |
| OpenBench/migrations/0001_initial.py | Initial schema snapshot (included in PR). |
| .gitignore | Stops ignoring migrations; ignores .epd; minor tweaks. |
| OpenBench/config.py | Bumps static version + adds fastchess config verification + preset key support. |
| OpenBench/apps.py | Removes artifact watcher startup; improves lockfile cleanup. |
| manage.py | Adds SIGTERM handler for graceful watcher shutdown under runserver. |
| Engines/Torch.json | Adds build path/compilers and updates presets. |
| Engines/Stockfish.json | Updates NPS + branches/books. |
| Engines/Stash.json | Updates books/presets/cpuflags. |
| Engines/Halogen.json | Updates NPS/compilers/books/bounds. |
| Engines/Dragon.json | Removes engine config. |
| Engines/Berserk.json | Updates books/presets/options and adds upload_pgns where needed. |
| Documentation/openbench.yml | Removes outdated GitHub Actions example workflow doc. |
| Config/config.json | Bumps client version + adds fastchess repo/min version + new books. |
| Client/utils.py | Reworks engine preparation; changes pkill behavior; drops artifact-selection logic. |
| Client/pgn_util.py | Reworks PGN processing + adds CLI entrypoint. |
| Client/genfens.py | Updates distribution fields + adds FEN->EPD conversion + new argument shape. |
| Client/cleanup.sh | Fixes PGNs path + removes wrong cleanup target. |
| Client/bench.py | Removes private-network bench handling; updates parsing/bench invocation. |
| Books/fortresses_150_250.epd.json | Adds book metadata. |
| Books/endgames_cdb95105.epd.json | Adds book metadata. |
| Books/DFRC_4852_v1.epd.json | Adds book metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+12
to
+15
| <script> | ||
| document.addEventListener('DOMContentLoaded', function() { | ||
| populate_results({{results|safe}}); | ||
| }); |
Comment on lines
+55
to
+65
| tr.innerHTML = ` | ||
| <td><a href="/machines/${result.machine__id}">${result.machine__id}</a></td> | ||
| <td>${result.machine__user__username.charAt(0).toUpperCase() + result.machine__user__username.slice(1)}</td> | ||
| <td class="">${formatted}</td> | ||
| <td class="numeric">${result.games}</td> | ||
| <td class="numeric">${result.wins}</td> | ||
| <td class="numeric">${result.losses}</td> | ||
| <td class="numeric">${result.draws}</td> | ||
| <td class="numeric">${result.timeloss}</td> | ||
| <td class="numeric">${result.crashes}</td> | ||
| `; |
Comment on lines
+68
to
+71
| // Only display Threads=X Hash=X ... | ||
| const re_threads = cell.textContent.match(/Threads=\d+/)[0]; | ||
| const re_hash = cell.textContent.match(/Hash=\d+/)[0]; | ||
| const new_text = re_threads + ' ' + re_hash + ' ...' |
Comment on lines
29
to
33
| <th class="cursor" onclick="sort_networks(['name'])">Name</th> | ||
| <th class="cursor" onclick="sort_networks(['scale_nps'])">NPS Scale</th> | ||
| <th class="cursor" onclick="sort_networks(['sha256'])")>Hash</th> | ||
| <th></th> | ||
| <th></th> |
| test.info = dev_info[4] | ||
|
|
||
| test.dev = get_engine(*dev_info) | ||
| test.dev = Engine.objects.create(name=dev_info[1], source=dev_info[0], sha=dev_info[2], bench=dev_info[3]) |
| test.dev_time_control = OpenBench.utils.TimeControl.parse(request.POST['dev_time_control']) | ||
|
|
||
| test.base = get_engine(*base_ingo) | ||
| test.base = Engine.objects.create(name=base_info[1], source=base_info[0], sha=base_info[2], bench=base_info[3]) |
Comment on lines
+384
to
+387
| # SPSA Delta update vector; might not have this | ||
| raw_spsa_delta = request.POST.get('spsa_delta', '') | ||
| spsa_delta = json.loads(raw_spsa_delta) if raw_spsa_delta else [] | ||
|
|
Comment on lines
+443
to
+449
| # Apply updates to every Parameter, ensuring clipping | ||
| parameters = list(test.spsa_run.parameters.order_by('index')) | ||
| for delta, param in zip(spsa_delta, parameters): | ||
| param.value = max(param.min_value, min(param.max_value, param.value + delta)) | ||
|
|
||
| # Bulk update to fire off all the .save()s | ||
| SPSAParameter.objects.bulk_update(parameters, ['value']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is a merge of upstream changes and a few fixes to keep our quirks as they were before merge. It will require database migration.