Allow storing NPS scaling for networks.#5
Allow storing NPS scaling for networks.#5Menkib64 wants to merge 3 commits intoLeelaChessZero:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for storing and using a per-network NPS scaling value (“NPS Scale”) so workload scaling defaults can be derived from the selected/default network rather than only engine-level configuration.
Changes:
- Introduces
Network.scale_npsin the Django model and wires it into network edit + list views. - Exposes
scale_npsvia the/api/networks/<engine>/endpoint. - Updates workload creation UI/JS to prefill “Expected NPS” from the default network’s
scale_npswhen available.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Templates/OpenBench/networks.html | Displays scale_nps in the networks table and adds sorting by it. |
| Templates/OpenBench/network.html | Adds an editable scale_nps field to the network edit form. |
| Templates/OpenBench/create_workload.html | Triggers network-change handling when selecting dev/base networks. |
| OpenBench/views.py | Includes scale_nps in the API networks response payload. |
| OpenBench/utils.py | Persists scale_nps from the edit form with validation. |
| OpenBench/static/create_workload.js | Auto-populates scale NPS from the default network (and on network changes). |
| OpenBench/models.py | Adds scale_nps field to the Network model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <th class="cursor" onclick="sort_networks(['author'])">Author</th> | ||
| <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> |
There was a problem hiding this comment.
The Hash column header has a malformed onclick attribute (onclick="sort_networks(['sha256'])")), which makes the HTML invalid and can break sorting. Remove the extra ") so the handler is a valid attribute value.
| <th class="cursor" onclick="sort_networks(['sha256'])")>Hash</th> | |
| <th class="cursor" onclick="sort_networks(['sha256'])">Hash</th> |
| </div> | ||
|
|
||
| <div class="row"> | ||
| <label for="default"> Default </label> | ||
| <select id="default" name="default"> |
There was a problem hiding this comment.
The newly added scale_nps row is immediately followed by the Default <select>, but that <select> block is not closed correctly later in the template (it ends with <select> instead of </select>). This can lead to malformed DOM and unreliable form behavior; update the closing tag to </select> (and do the same for the was_default select below).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.