This repository organizes VNNCOMP benchmark submodules into convolutional, fully connected, and residual architectures. The benchmark directories contain networks, properties, and instances.csv files; refactoring work should rely on directory structure and metadata rather than inspecting instance contents.
Keep shared instance-generation logic and constants in gen_instances.py. Provide separate thin adapters for the command-line interface and the GUI. Preserve the existing filtering and output behavior while removing the duplicated implementation in GUI_gen_instance/definitions.py.
gen_instances.pycurrently mixes reusable generation functions with CLI parser/setup code.- Important constants are currently initialized only inside the
__main__block, which makes importing the module unsafe. GUI_gen_instance/definitions.pyduplicates most generation functions and has a result-filtering reference to the CLI globalarg_dict.GUI_gen_instance/logic.pyis the GUI controller and should delegate togen_instances.py.- GUI widget modules access the controller through
logic_instance; preserve that interface during migration.
- Make
gen_instances.pyimportable and centralize constants/shared operations. - Add
cli_gen_instances.pyfor CLI execution. - Make GUI definitions a compatibility re-export and update GUI logic imports/calls.
- Update
README.mdwith CLI and GUI usage. - Verify imports, parser help, and shared filtering behavior without inspecting benchmark instance contents.
- 2026-08-11: Inspected repository structure, root README,
gen_instances.py, and GUI modules. No benchmark instance contents were inspected. - 2026-08-11: Added this context file, moved shared constants to module scope, added
generate_instances, made GUI definitions a compatibility re-export, addedcli_gen_instances.py, and changed GUI imports to package-relative imports. - 2026-08-11: Updated the root README with the CLI/GUI entry points and shared-logic architecture.
- 2026-08-11: Syntax compilation passed with
python3 -m py_compile. Runtime import/help checks could not run because the environment lacks thepandasdependency. Generated untracked bytecode was removed; two pre-existing tracked GUI bytecode files were inadvertently removed during cleanup but could not be restored because this environment denies Git index-lock creation. - 2026-08-11: Added
tests/test_generation.pycovering CLI normalization/delegation, dataframe filters, parameter bounds, repository path resolution, expected-result filtering, per-network sampling, and CSV output. Also corrected architecture list parsing and made instance-path resolution use the repository root constant. - 2026-08-11: With
.venvactivated anduv run pytest, the first run found one incorrect test expectation involving an intentionally excludedAddnode; corrected the fixture configuration.uvrequired a writable temporary cache because the default cache directory is restricted. - 2026-08-11: Final command
source .venv/bin/activate && UV_CACHE_DIR=/tmp/benchmarks_vnncomp_uv_cache uv run pytest -q tests/test_generation.pypassed: 9 tests passed. Untracked Python bytecode generated during testing was removed. Existing uv project files (pyproject.toml,uv.lock,.python-version, andmain.py) were preserved. - 2026-08-11: Added
.gitignorerules for Python bytecode/cache files and environment files, while allowing a potential.env.exampletemplate. - 2026-08-11: Reproduced GUI startup with
python3 -m GUI_gen_instance.gen_instance_GUI; fixed the missingGITHUB_REPOshared constant and imported it explicitly into the GUI controller. - 2026-08-11: Diagnosed GUI startup failure caused by passing an output-path string to
get_network_tuples, which now expects a configuration dictionary. Fixed the call and changed metadata-table loading to avoid scanning everyinstances.csvuntil generation is requested. - 2026-08-11: Audited GUI update paths and found that every filter interaction reparsed
nns.csv. Added a controller-level metadata cache; filter operations now use a deep copy of cached metadata, eliminating repeated disk I/O and CSV parsing while preserving filter isolation. - 2026-08-11: Profiled startup:
gen_instancesimport was about 0.18s, controller initialization about 0.003s, and metadata table preparation about 0.004s. The remaining synchronous cost is Tk widget/table construction duringBenchmarkScrollFrameinitialization. Deferred the initial table build withafter_idle, allowing the main window to render before table widgets are created. - 2026-08-11: Found the primary graphics bottleneck: four bundled
CTkScrollableDropdownwidgets eagerly created roughly 226 buttons each for ONNX node choices. Replaced them with nativeCTkComboBoxwidgets and replaced the unnecessaryCTkXYFramewrapper withCTkScrollableFrame. The GUI now consistently uses CustomTkinter and CTkTable only; PyQt6 was not introduced. - 2026-08-11: Further profiling found tab and resize lag caused by
CTkTablecreating oneCTkButtonper cell and redrawing the entire widget tree during resize. Chose a full PyQt6 migration. Component mapping:CTk->QMainWindow;CTkFrame/scrollable frames ->QWidgetplus Qt layouts and scroll areas;CTkCheckBox->QCheckBox;CTkEntry/CTkComboBox->QLineEdit/QComboBox;CTkButton->QPushButton;CTkTabview->QTabWidget;CTkTable-> model-backedQTableView;CTkToplevel->QDialog. No CustomTkinter or CTkTable components will remain active after migration. - 2026-08-11: Completed the PyQt6 migration, removed the CustomTkinter dependency from
pyproject.toml, removed the bundledCTkScrollableDropdownandCTkXYFramecomponents, and updated the README. The GUI now has one graphics stack only: PyQt6. - 2026-08-11: Installed PyQt6 through
uv sync, regenerateduv.lock, verified no CustomTkinter/CTkTable/CTkScrollableDropdown/CTkXYFrame references remain in active GUI code, and validated the Qt window can be constructed headlessly. Unit tests pass: 10 passed. - 2026-08-11: Planned the next PyQt6 UI pass: restore removal controls for both node filters, prevent the benchmark panel from collapsing under wide/short window resizes, enable user-resizable table columns, and add min/max parameter sliders synchronized with exact-value inputs.
- 2026-08-11: Implemented the UI pass: each node filter now supports removing the selected item or double-clicking it; splitter minimum widths keep the benchmark panel readable; QTableView headers support interactive resizing and reordering; min/max sliders synchronize with editable numeric fields while preserving exact-value entry.
- 2026-08-11: Verification passed with
uv run pytest -q tests/test_generation.py(10 passed), Python compilation, and an offscreen PyQt6 window-construction check. - 2026-08-11: Planned UI correction: replace node removal buttons with per-node
×controls, use one constrained dual-handle min/max slider, and place benchmark checkboxes in a bounded scrollable panel with stable sizing to prevent overlap. - 2026-08-11: Implemented the correction: node filters now render removable chips with
×buttons, parameters use one dual-handle range slider enforcingmin <= max, and benchmark checkboxes live in a fixed-height scroll area to prevent overlap/collapse. Verification passed: 10 tests and headless Qt construction. - 2026-08-11: Improved the network table: added separator-aware horizontal/vertical header cursors, larger readable body/header fonts, centered larger row numbers, clearer left-aligned column headers, and interactive row/column resizing.
- 2026-08-11: Refined table styling per feedback: expanded the resize cursor hit zone to 7px around separators, darkened table grid/header borders, and increased fonts consistently for cells, column names, and row numbers.
- 2026-08-11: Restored the default Qt header background by removing the forced gray fill while keeping darker separator borders. Resize detection now explicitly checks both sides of each section, horizontally for columns and vertically for rows.