Releases: Pascal-Jansen/Bayesian-Optimization-for-Unity
Releases · Pascal-Jansen/Bayesian-Optimization-for-Unity
Release list
v1.5.0
Contextual Optimization (LCE-M GP)
- Added contextual multi-task optimization built on BoTorch's
LCEMGP(Feng et al., NeurIPS 2020) for both the single-objective (bo.py) and multi-objective (mobo.py) BoTorch backends. - Context embeddings are definable: learned from data, supplied manually per context (any encoder, e.g. ViT-G/14 vectors), or computed from context images via open_clip (default
ViT-bigG-14, the open_clip release of ViT-G/14) with content-hashed caching and optional L2 normalization. - Warm-start parameter CSVs accept a
Contextcolumn to transfer observations from other contexts (users, devices, environments); new observations are tagged with the current context. - Run metrics (
coverage,IsBest/IsPareto, hypervolume/best-objective traces) and the loggedIterationindex are computed over current-context observations only;ObservationsPerEvaluation.csvgains aContextcolumn. - New
BoForUnityManagerinspector section with live validation and fail-fast startup checks; contextual mode is BoTorch-only (CABOP rejects it with a clear error). - Worked around a BoTorch
LCEMGPtask-kernel dimensionality issue whencontext_emb_featureis provided.
CABOP Fixes
- Fixed a critical parameter-ordering bug: with multiple CABOP groups whose parameters interleave in declaration order, parameter values were silently assigned to the wrong parameter names (in Unity payloads, observation logs, and warm-start data). Vectors now always follow parameter declaration order.
- Fixed a spurious
AssertionErrorwhen the acquisition optimizer landed exactly on a parameter bound (floating-point overshoot); proposals are now clamped to bounds. IsBest/IsParetomarker flags are now derived from full-precision scalarized values instead of the rounded CSV values, and no longer re-scan the whole CSV every iteration.- Zero-configured costs and degenerate GP predictions no longer produce division-by-zero in the acquisition function.
- The CABOP runtime now tolerates malformed/unrelated protocol messages the same way as the BoTorch backends.
Runtime and Tooling
- The optimizer's Python process now runs with
PYTHONDONTWRITEBYTECODE=1, keeping__pycache__folders out ofStreamingAssets. - Fixed a pandas dtype issue when writing
IsBestflags duringbo.pysampling runs. - Context image paths configured on Windows now also resolve on macOS/Linux.
MainThreadDispatcherno longer holds its queue lock while running actions, and one failing action can no longer abort the rest of the frame's queue.- Removed the dead
Optimizer.UpdateParameterAPI (it referenced CSV data that was never loaded). - Added example warm-start CSVs with a
Contextcolumn (ExampleContextInitData*.csv); documented the optionalopen_clip_torch/pillowdependencies inrequirements.txt. - Added a manually triggered Release workflow that tests, rolls this changelog, bumps
bundleVersion, and creates the GitHub release.
Tests
- Added unit tests for the context protocol and embedding pipeline, plus real-BoTorch integration tests running full contextual BO/MOBO loops (skipped automatically on CI environments without torch).
- Added CABOP backend tests, including a multi-group ordering regression test and bounds/zero-cost edge cases (skipped when scipy/scikit-learn/loguru are unavailable).
- Added Unity EditMode tests for final-design selection and objective key matching.
- Consolidated the duplicated torch/botorch test stubs into a shared
tests/_stubs.py. - Added a weekly/manual
full-stack-testsCI job that runs the complete suite against the real pinned dependency stack (CPU torch).
Documentation
- New README section 8.13 on contextual optimization and context embeddings (incl. ViT-G/14 guidance), new troubleshooting entries, and a note on
Iterationnumbering semantics for warm-started and contextual runs.
v1.4.2
Fitts Law Study Workflow
- Added a unified Fitts Law scene with selectable
HITL MOBO,Static, andRandomconditions. - Added explicit Fitts Law design parameters:
x_font_size,button_size,button_distance,button_hue, andbutton_saturation; brightness remains fixed at0.5. - Added target
Xmarker support and disabled target outlines/red wrong-click flashing by default. - Added layout safeguards to prevent target overlap.
Objectives and Logging
- Updated Fitts Law objectives to
aesthetics,speed,accuracy, andusability. - Logs now use a shared structure under
Assets/StreamingAssets/BOData/LogData/<USER>/<CONDITION>/. - Questionnaire logs now include
UserID,ConditionID, andGroupIDvia Additional CSV Items. - Added detailed Fitts app/trial telemetry logs, including click counts, timing, accuracy, iteration, phase, and design parameters.
- Added duplicate user-folder protection using suffixes like
_1.
Runtime and Tooling
- Improved Python setup to avoid main-thread Unity API calls from worker threads.
- Updated Python requirement handling for the bundled Python 3.13 runtime.
- Fixed PlayMode test asmdef references and removed the previous
UnityTestdependency issue.
Documentation
- Expanded README coverage for Fitts Law conditions, parameters, objectives, questionnaire setup, logging paths, and troubleshooting.
v1.4.1
- Replaced BoTorch’s internal Pareto/hypervolume metric utilities with moocore-backed wrappers while preserving existing MOBO behavior.
- Added tensor/array conversion helpers, maximization-aware Pareto and hypervolume wrappers, duplicate-first Pareto retention, updated tests, and moocore installation support for requirements plus Linux/macOS setup checks.
- Also improved Unity Python dependency setup by trying an upgrade install first, then falling back to a non-upgrade install so existing compatible packages could still be reused if upgrades failed.
v1.4.0
Added
- New Fitts' Law task for experimental and interaction evaluation workflows.
Fixes
- Various bug fixes with the Unity Editor inspector user interface.
Cleaned Up
- Updated the repository's
.gitignoreto better match Unity project structure. - Removed generated IDE, solution, and Unity build/runtime artifacts from version control.
v1.3.0
🚀 Robust HITL BO Loop & Protocol Hardening
- Replaced ad-hoc socket reader with buffered NDJSON framing (recv_json_message), preserved unread bytes, added socket timeouts, SO_REUSEADDR, and stricter send/receive error handling.
- Added extensive fail-fast validation (parameters, objectives, bounds, shapes, non-finite values, duplicate keys, CSV layout checks).
- Enforced batchSize=1 (warning) and improved logging of init config, timeouts, and warm-start format.
📊 Warm-Start Reliability & Normalization
- Added WARM_START_OBJECTIVE_FORMAT (auto | raw | normalized_max | normalized_native) with strict validation.
- Improved normalize_param_column / normalize_obj_column:
- Auto-detect raw vs. normalized data with epsilon tolerance.
- Correct scaling to [0,1] (params) and [-1,1] (objectives).
- Proper sign handling for minimization flags.
- Safe clipping and degenerate-range handling.
- Hardened warm-start CSV loading: existence checks, column validation, numeric conversion, row consistency, model-space normalization.
- Preserve full precision when denormalizing optimizer parameters.
🔍 Data Integrity & Logging Improvements
- Runtime sanity checks for iteration counts, restart/sample sizes, objective validity.
- Improved objective reception: explicit errors for missing/non-finite values.
- Best objective now logged to BestObjectivePerEvaluation.csv (mirrored to legacy HypervolumePerEvaluation.csv).
- Robust IsPareto / IsBest handling with fallback logic and mismatch warnings.
- Improved CSV IO helpers and configuration parsing.
🔄 Iteration Flow Control (Unity)
- New iteration progression modes:
- NextButton
- ExternalSignal
- Automatic (with delay coroutine)
- Added RequestNextIteration() API.
- Improved state management, scene reload toggle, and protection against double-advances.
- Updated Inspector UI to expose new settings.
🏁 Optional Final Design Evaluation
- Added FinalDesignSelector:
- Deterministic selection from ObservationsPerEvaluation.csv
- Supports utopia distance, maximin, aggression metrics with tie-breaking.
- Integrated optional final round (totalIterations + 1) without sending objectives back to Python.
- Inspector controls and README documentation added.
- Input validation and error reporting for selection failures.
🧪 Tests & Documentation
- Added unit tests (test_bo.py, test_mobo.py).
- Expanded README: glossary, quick start, integration checklist, warm-start examples, troubleshooting.
- Improved diagnostics for protocol and normalization debugging.
🛠 Miscellaneous
- Added socket buffer constant and timeout env config (BO_SOCKET_TIMEOUT_SEC).
- Improved precision handling, tensor stacking, bounds validation.
- Updated Unity project files and platform scripts.
- Included StreamingAssets BO data and refreshed project metadata.
v1.2.0
Highlights:
- Added support for single-objective optimization.
- Added single-objective example scene: Color Guesser (3 Parameters, 1 Objective)
Full Changelog: v.1.1.2...v1.2.0
v1.1.2
What's Changed
-
Guard success message on expected optimization completion
-
Handle successful socket shutdown without noisy logs
-
Clarify peer shutdown handling
-
Upgraded Python version and Python library requirements
-
Clarified how to get parameter values and set objective values via code on the Unity side in the README.
Full Changelog: v1.1.1...v.1.1.2
v1.1.1
What's Changed
- Harden questionnaire and network parsing against locale differences.
- Changed socket communication to JSON messages.
Full Changelog: v1.1.0...v1.1.1
v1.1.0
Highlights
- Click Game example scene
Minimal 2-objective task (time-to-click, perceived difficulty). Ready to plug into the BO loop. - Acquisition upgrade: qNEHVI → qLogNEHVI
Replaced legacy qNoisyExpectedHypervolumeImprovement with qLogNoisyExpectedHypervolumeImprovement for better numerical stability. Same API.
from botorch.acquisition.multi_objective.logei import qLogNoisyExpectedHypervolumeImprovement - Simplified BO Manager inspector (Unity)
Cleaner grouping, clearer hyperparameters, and safer defaults. - Python bootstrap
Auto-detects a Python executable and installsrequirements.txtfrom
StreamingAssets/BOData/Installation/automatically. - Sampling rule: 2d + 1
The number of sampling iterations now defaults to2 * num_design_params + 1. Toggle manual override if needed.
Upgrade notes
- Ensure StreamingAssets/BOData/Installation/requirements.txt is present; the runner installs packages automatically.
- If you previously set a fixed sampling count, enable “Set Sampling Iterations Manually” in the inspector to keep. Otherwise, the default is 2d+1.
Changelog
- Add: Click Game example scene.
- Change: Switch to qLogNoisyExpectedHypervolumeImprovement.
- Improve: BO Manager inspector UX.
- Add: Default Python path detection + automatic requirements.txt install.
- Add: Automatic sampling iterations = 2d+1.
v1.0.1
Now using the qNEHVI acquisition function as a default setting.
qNEHVI is far more efficient for noisy data typical of human feedback than qEHVI and mathematically equivalent in the noiseless setting, see: https://botorch.org/docs/tutorials/multi_objective_bo/