Skip to content

feat: integrate feature extraction into perform - #44

Closed
ucodia wants to merge 9 commits into
mainfrom
feat/feature-extraction-redesign
Closed

feat: integrate feature extraction into perform#44
ucodia wants to merge 9 commits into
mainfrom
feat/feature-extraction-redesign

Conversation

@ucodia

@ucodia ucodia commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the standalone Feature Extractor tool with feature extraction built directly into the Perform screen's Adjust Input widget. Extraction is now zero config (fbpca, 8 features, deterministic seeding) and runs in a background process while rendering continues. Results are stored per model under the app data folder, keyed by model content hash, and load automatically whenever that model is opened. The old workflow (pick model, choose folder, extract, reopen model in Perform, browse, load) collapses to a single Extract features click per model.

The GANSpace logic moves from ganspace/ into a new tested features/ package (estimators, extraction core, store, worker), covered by the test suite and a new CI workflow.

Highlights:

  • Adjust Input header: Add input, Randomize all, Extract features with inline progress and cancel.
  • Sliders are labeled feature or random so extracted directions are distinguishable from randomized ones. Reset restores the extracted direction.
  • Deterministic extraction: same model always yields the same directions (seeded sampling, sign stabilization). Conditional models supported via zero labels.
  • Versioned preset state replaces the raw tuple pickle. Old adjuster presets are skipped gracefully.
  • The renderer now reports the model latent size, fixing the hardcoded 512 in the old widget.
  • Fixes long-standing bugs: extraction worker could only run once per app session, identical X/Z component files, MPS model shipping across processes.

Type of change

  • Feature
  • Fix
  • Other (docs, refactor, chore, ci, etc.)

How was this tested?

Automated: 52 tests pass (uv run pytest) covering estimator contracts, extraction determinism, sign stabilization, clamping, cancellation, conditional models, RNG state restoration, store roundtrip and hash collision handling, worker job protocol, and preset state validation. A new GitHub Actions workflow runs the suite on push and PR.

Manual (macOS, MPS): extraction end to end on a conditional 1024px model from Perform, background progress with live rendering, auto load on model reopen, Re-extract, per slider Randomize and Reset with feature/random labels, header layout.

Still needs manual verification:

  • Windows CUDA end to end extraction (worker process, path handling).
  • Preset save and load with nonzero weights and OSC mappings, including that model auto load does not overwrite preset state.
  • Loading a pre redesign preset folder (adjuster state should be skipped with a log line, everything else loads).
  • Feature reload after moving or renaming a model file (content hash fallback).
  • Two models with identical filenames in different folders keep separate features.

Checklist

  • PR title follows Conventional Commits without a scope (<type>: <subject>)
  • I have read CONTRIBUTING.md
  • Documentation in docs/ or README.md is updated if user-visible behavior changed
  • If this PR adds new runtime files, they are included in release.py (no new runtime files: features/ is pure code, bundled automatically)
  • Screenshots or a short clip are attached for UI changes

Note: docs screenshots for the Tools and Adjust Input pages still show the old UI and need recapturing.

This PR was developed with the assistance of an AI coding tool.

Generated with AI assistance

@ucodia
ucodia force-pushed the feat/feature-extraction-redesign branch from 5b908a5 to af1b4e8 Compare July 24, 2026 08:04
@ucodia
ucodia force-pushed the feat/feature-extraction-redesign branch from 2275789 to fb344b4 Compare August 2, 2026 05:15
@ucodia

ucodia commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

Closed in favour of #50

@ucodia ucodia closed this Aug 2, 2026
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.

1 participant