bdo-toolkit 1.0.13__tar.gz → 1.0.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bdo_toolkit-1.0.13/src/bdo_toolkit.egg-info → bdo_toolkit-1.0.15}/PKG-INFO +1 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_version.py +1 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_detail_learning.py +109 -32
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_details.py +43 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_discovery.py +2 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15/src/bdo_toolkit.egg-info}/PKG-INFO +1 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit.egg-info/SOURCES.txt +1 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_solare_details.py +38 -0
- bdo_toolkit-1.0.15/tests/test_solare_history.py +92 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_solare_learning.py +36 -7
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_solare_learning_adversarial.py +45 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_solare_replay.py +3 -3
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/LICENSE +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/README.md +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/pyproject.toml +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/setup.cfg +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_async_sessions.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_async_utils.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/_constants.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/_formatting.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/_records.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/analysis.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/companions.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/live.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/observations.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/persistence.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/progress.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_calibration/workflow.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_capture_backend.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_capture_options.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_capture_runtime.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_deposit_origin.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_engine.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_framing.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/_constants.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/_records.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/assembly.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/formatting.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/inventory.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_item_state/storage.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_observation_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_origin/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_origin/discovery.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_origin/manual.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_origin/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_origin/tracker.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_profile_io.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_profile_runtime.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_protocol.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_reassembly.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_record_geometry.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_specs.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_storage_destination_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_storage_hydration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/_tracked_capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/_calibration_models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/_capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/_discovery.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/_profile.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/async_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/calibration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/agris/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/calibration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/capture_diagnosis.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/character_state.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/cli.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/diagnostics.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/events.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/filters.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/grind/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/grind/_pipeline.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/grind/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/grind/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/item_state.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/origin_learning.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/profiles.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/py.typed +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/raw/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/raw/_collector.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/raw/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/raw/replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/raw/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/remote_profiles.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_constants.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_live_tracker.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_replay_capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_result.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_scanner.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/async_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/solare/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/writers.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/xp/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/xp/_tracker.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/xp/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/xp/profile.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/xp/replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit/xp/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit.egg-info/dependency_links.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit.egg-info/entry_points.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit.egg-info/requires.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/src/bdo_toolkit.egg-info/top_level.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_agris_async.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_agris_cli.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_agris_discovery.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_agris_evidence.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_agris_models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_agris_profiles.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_agris_replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_agris_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_async_sessions.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_calibration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_calibration_conveniences.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_calibration_lifecycle.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_calibration_persistence.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_calibration_progress.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_calibration_retention.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_capture_backend.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_capture_diagnosis.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_capture_replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_capture_runtime.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_character_state.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_cli.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_decoder_diagnostics.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_deposit_origin.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_direction.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_dynamic_storage_calibration_matrix.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_engine.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_examples_and_writers.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_explicit_profile.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_fixture_catalog.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_fixture_regressions.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_framing.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_grind.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_initial_load_storage.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_inventory_snapshots.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_item_state.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_live_capture_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_origin_learning.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_package_layout.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_profile_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_raw.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_reassembly.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_remote_profiles.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_solare_api.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_solare_equipment.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_solare_real_captures.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_solare_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_storage_destination_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_storage_events.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_storage_hydration_tracker.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_storage_unknown_destination_calibration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_toolkit_api.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_xp.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.15}/tests/test_xp_profiles.py +0 -0
|
@@ -16,7 +16,7 @@ import itertools
|
|
|
16
16
|
import re
|
|
17
17
|
from collections import Counter
|
|
18
18
|
from dataclasses import dataclass, replace
|
|
19
|
-
from typing import Mapping, Optional, Sequence
|
|
19
|
+
from typing import Callable, Mapping, Optional, Sequence
|
|
20
20
|
|
|
21
21
|
from bdo_toolkit._protocol import BDOFrame
|
|
22
22
|
|
|
@@ -35,6 +35,8 @@ from ._details import (
|
|
|
35
35
|
_OverallDetailLayout,
|
|
36
36
|
_RichDetailLayout,
|
|
37
37
|
_decode_history_region,
|
|
38
|
+
_history_outcome_counts,
|
|
39
|
+
_history_matches_outcomes,
|
|
38
40
|
_decode_overall_aggregate_performance,
|
|
39
41
|
_decode_performance_slots,
|
|
40
42
|
_read_name,
|
|
@@ -558,6 +560,7 @@ def _balanced_counter_solution(
|
|
|
558
560
|
occupancies: Sequence[int],
|
|
559
561
|
*,
|
|
560
562
|
records: Optional[_RecordTable] = None,
|
|
563
|
+
validate: Optional[Callable[[int, tuple[int, int, int]], bool]] = None,
|
|
561
564
|
) -> Optional[tuple[int, tuple[int, int, int]]]:
|
|
562
565
|
record_size = len(rows[0])
|
|
563
566
|
occupied_activity = [0] * _CLASS_SLOT_COUNT
|
|
@@ -624,15 +627,13 @@ def _balanced_counter_solution(
|
|
|
624
627
|
ordered = sorted(
|
|
625
628
|
(left_offset, right_offset, third_offset)
|
|
626
629
|
)
|
|
627
|
-
solutions.add(
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
(ordered[0], ordered[1], ordered[2]),
|
|
631
|
-
)
|
|
632
|
-
)
|
|
633
|
-
if len(solutions) > 1:
|
|
630
|
+
solutions.add((matches_offset, (ordered[0], ordered[1], ordered[2])))
|
|
631
|
+
# Never truncate a search and claim uniqueness.
|
|
632
|
+
if len(solutions) > 64:
|
|
634
633
|
return None
|
|
635
|
-
|
|
634
|
+
supported = [candidate for candidate in sorted(solutions)
|
|
635
|
+
if validate is None or validate(*candidate)]
|
|
636
|
+
return supported[0] if len(supported) == 1 else None
|
|
636
637
|
|
|
637
638
|
|
|
638
639
|
def _history_candidates(
|
|
@@ -694,10 +695,9 @@ def _history_outcome_candidates(
|
|
|
694
695
|
) -> tuple[tuple[int, int, int], ...]:
|
|
695
696
|
"""Constrain lifetime outcomes with complete or bounded recent histories.
|
|
696
697
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
positive orientation evidence. Ambiguous supported mappings stay unavailable.
|
|
698
|
+
Binary equal/unequal pairs give wins/losses; the observed (-1, 0) pair
|
|
699
|
+
gives draws. Complete short histories must match every lifetime component;
|
|
700
|
+
longer records must contain each recent count. Ambiguous mappings stay unavailable.
|
|
701
701
|
"""
|
|
702
702
|
candidates: list[tuple[int, int, int]] = []
|
|
703
703
|
for wins_offset, draws_offset, losses_offset in itertools.permutations(outcome_offsets):
|
|
@@ -713,27 +713,21 @@ def _history_outcome_candidates(
|
|
|
713
713
|
if decoded is None or len(decoded[1]) != 2 * min(matches, 5):
|
|
714
714
|
valid = False
|
|
715
715
|
break
|
|
716
|
-
|
|
717
|
-
equal = sum(codes[i] == codes[i + 1] for i in range(0, len(codes), 2))
|
|
718
|
-
unequal = len(codes) // 2 - equal
|
|
716
|
+
recent = _history_outcome_counts(decoded[1])
|
|
719
717
|
wins = _u32le(row, wins_offset + slot * 4)
|
|
720
718
|
draws = _u32le(row, draws_offset + slot * 4)
|
|
721
719
|
losses = _u32le(row, losses_offset + slot * 4)
|
|
722
|
-
if
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
break
|
|
726
|
-
elif draws != 0:
|
|
727
|
-
# A draw may occupy either pair category. These bounds
|
|
728
|
-
# reject contradictions without assigning it an encoding.
|
|
729
|
-
if wins + draws < equal or losses + draws < unequal:
|
|
730
|
-
valid = False
|
|
731
|
-
break
|
|
732
|
-
continue
|
|
733
|
-
elif wins < equal or losses < unequal:
|
|
720
|
+
if recent is None or not _history_matches_outcomes(
|
|
721
|
+
recent, matches, wins, draws, losses,
|
|
722
|
+
):
|
|
734
723
|
valid = False
|
|
735
724
|
break
|
|
736
|
-
if
|
|
725
|
+
if matches > 5 and draws and not recent[1]:
|
|
726
|
+
# An older lifetime draw absent from this window constrains
|
|
727
|
+
# candidates but does not positively identify the draw column.
|
|
728
|
+
# Preserve the existing witness requirement for binary history.
|
|
729
|
+
continue
|
|
730
|
+
if recent[0] != recent[2] or recent[1]:
|
|
737
731
|
discriminators += 1
|
|
738
732
|
if not valid:
|
|
739
733
|
break
|
|
@@ -794,20 +788,87 @@ def _companion_outcomes_agree(
|
|
|
794
788
|
return shared >= 20 and discriminating_names >= _MIN_HISTORY_DISCRIMINATORS
|
|
795
789
|
|
|
796
790
|
|
|
791
|
+
def _counter_geometry_check(
|
|
792
|
+
records: _RecordTable, class_offset: int, occupancies: tuple[int, ...],
|
|
793
|
+
source: _RecordTable, source_class: int, source_occupancies: tuple[int, ...],
|
|
794
|
+
) -> Optional[Callable[[int, tuple[int, int, int]], bool]]:
|
|
795
|
+
# Establish numerical geometry without assigning any W/D/L labels.
|
|
796
|
+
# An ambiguous source cannot corroborate another ambiguous response.
|
|
797
|
+
counters = _balanced_counter_solution(
|
|
798
|
+
source.rows, source_occupancies, records=source,
|
|
799
|
+
)
|
|
800
|
+
if counters is None:
|
|
801
|
+
return None
|
|
802
|
+
source_matches, source_outcomes = counters
|
|
803
|
+
if len(_history_candidates(source.rows, source_occupancies, source_matches)) != 1:
|
|
804
|
+
return None
|
|
805
|
+
by_name = {name: i for i, name in enumerate(source.names)}
|
|
806
|
+
|
|
807
|
+
def agrees(matches: int, outcomes: tuple[int, int, int]) -> bool:
|
|
808
|
+
shared = 0
|
|
809
|
+
for row, name, rank, occupied in zip(
|
|
810
|
+
records.rows, records.names, records.ranks, occupancies,
|
|
811
|
+
):
|
|
812
|
+
ordinal = by_name.get(name)
|
|
813
|
+
if ordinal is None:
|
|
814
|
+
continue
|
|
815
|
+
other = source.rows[ordinal]
|
|
816
|
+
if rank != source.ranks[ordinal] or occupied != source_occupancies[ordinal]:
|
|
817
|
+
return False
|
|
818
|
+
for slot in range(occupied):
|
|
819
|
+
if row[class_offset + slot] != other[source_class + slot]:
|
|
820
|
+
return False
|
|
821
|
+
if _u32le(row, matches + slot * 4) != _u32le(other, source_matches + slot * 4):
|
|
822
|
+
return False
|
|
823
|
+
if sorted(_u32le(row, off + slot * 4) for off in outcomes) != sorted(
|
|
824
|
+
_u32le(other, off + slot * 4) for off in source_outcomes
|
|
825
|
+
):
|
|
826
|
+
return False
|
|
827
|
+
shared += 1
|
|
828
|
+
return shared >= 20
|
|
829
|
+
return agrees
|
|
830
|
+
|
|
831
|
+
|
|
797
832
|
def _learn_performance_offsets(
|
|
798
833
|
records: _RecordTable,
|
|
799
834
|
class_offset: int,
|
|
800
835
|
occupancies: tuple[int, ...],
|
|
801
836
|
*,
|
|
802
837
|
companion: Optional[tuple[_RecordTable, _PerformanceOffsets]] = None,
|
|
838
|
+
counter_check: Optional[Callable[[int, tuple[int, int, int]], bool]] = None,
|
|
803
839
|
) -> Optional[_PerformanceOffsets]:
|
|
804
840
|
spec_offset = _learn_spec_offset(records.rows, occupancies)
|
|
841
|
+
if spec_offset is None:
|
|
842
|
+
return None
|
|
843
|
+
|
|
844
|
+
def validate(matches: int, outcomes: tuple[int, int, int]) -> bool:
|
|
845
|
+
if counter_check is not None and not counter_check(matches, outcomes):
|
|
846
|
+
return False
|
|
847
|
+
return _validate_performance_candidate(
|
|
848
|
+
records, class_offset, occupancies, spec_offset, matches, outcomes,
|
|
849
|
+
companion=companion,
|
|
850
|
+
) is not None
|
|
805
851
|
counters = _balanced_counter_solution(
|
|
806
|
-
records.rows, occupancies, records=records,
|
|
852
|
+
records.rows, occupancies, records=records, validate=validate,
|
|
807
853
|
)
|
|
808
|
-
if
|
|
854
|
+
if counters is None:
|
|
809
855
|
return None
|
|
810
|
-
|
|
856
|
+
return _validate_performance_candidate(
|
|
857
|
+
records, class_offset, occupancies, spec_offset, *counters,
|
|
858
|
+
companion=companion,
|
|
859
|
+
)
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
def _validate_performance_candidate(
|
|
863
|
+
records: _RecordTable,
|
|
864
|
+
class_offset: int,
|
|
865
|
+
occupancies: tuple[int, ...],
|
|
866
|
+
spec_offset: int,
|
|
867
|
+
matches_offset: int,
|
|
868
|
+
outcome_offsets: tuple[int, int, int],
|
|
869
|
+
*,
|
|
870
|
+
companion: Optional[tuple[_RecordTable, _PerformanceOffsets]] = None,
|
|
871
|
+
) -> Optional[_PerformanceOffsets]:
|
|
811
872
|
histories = _history_candidates(
|
|
812
873
|
records.rows,
|
|
813
874
|
occupancies,
|
|
@@ -840,6 +901,11 @@ def _learn_performance_offsets(
|
|
|
840
901
|
oriented = supported[0]
|
|
841
902
|
if oriented is None:
|
|
842
903
|
return None
|
|
904
|
+
if companion is not None and not _companion_outcomes_agree(
|
|
905
|
+
records, class_offset, occupancies, matches_offset, oriented,
|
|
906
|
+
companion[0], companion[1],
|
|
907
|
+
):
|
|
908
|
+
return None
|
|
843
909
|
wins_offset, draws_offset, losses_offset = oriented
|
|
844
910
|
active = tuple(
|
|
845
911
|
(offset, vector) for offset in outcome_offsets
|
|
@@ -1743,6 +1809,17 @@ def learn_unknown_solare_details(
|
|
|
1743
1809
|
and overall_class is not None
|
|
1744
1810
|
else None
|
|
1745
1811
|
)
|
|
1812
|
+
if (learn_overall and overall_performance is None and rich_performance is None
|
|
1813
|
+
and overall_class is not None and rich.class_offset is not None
|
|
1814
|
+
and rich_occupancies is not None):
|
|
1815
|
+
check = _counter_geometry_check(
|
|
1816
|
+
overall_records, overall_class[0], overall_class[1],
|
|
1817
|
+
rich_records, rich.class_offset, rich_occupancies,
|
|
1818
|
+
)
|
|
1819
|
+
if check is not None:
|
|
1820
|
+
overall_performance = _learn_performance_offsets(
|
|
1821
|
+
overall_records, overall_class[0], overall_class[1], counter_check=check,
|
|
1822
|
+
)
|
|
1746
1823
|
if learn_overall and overall_performance is None and rich_performance is not None and overall_class is not None:
|
|
1747
1824
|
overall_performance = _learn_performance_offsets(
|
|
1748
1825
|
overall_records, overall_class[0], overall_class[1],
|
|
@@ -51,7 +51,11 @@ _GEAR_SLOT_SIZE = 0x7D1
|
|
|
51
51
|
_ADDON_SLOT_SIZE = 0x1F5
|
|
52
52
|
_MAX_PLAUSIBLE_MATCHES = 1_000_000
|
|
53
53
|
_MAX_PLAUSIBLE_ELO = 1_000_000
|
|
54
|
-
|
|
54
|
+
# Preserve the registered reader's legacy opaque binary strings. Signed histories
|
|
55
|
+
# must contain complete observed pairs; (-1, 0) is the UI-verified draw encoding.
|
|
56
|
+
_HISTORY_PATTERN = re.compile(
|
|
57
|
+
r"(?:[01](?:,[01]){0,9}|(?:[01],[01]|-1,0)(?:,(?:[01],[01]|-1,0)){0,4})"
|
|
58
|
+
)
|
|
55
59
|
|
|
56
60
|
|
|
57
61
|
@dataclass(frozen=True)
|
|
@@ -322,6 +326,36 @@ def _specialization(class_code: int, code: int) -> SolareSpecialization:
|
|
|
322
326
|
return SolareSpecialization(code=code, branch="succession", name="Succession")
|
|
323
327
|
|
|
324
328
|
|
|
329
|
+
def _history_outcome_counts(codes: Sequence[int]) -> Optional[tuple[int, int, int]]:
|
|
330
|
+
"""Count observed W/D/L pairs without assigning individual token meanings."""
|
|
331
|
+
if len(codes) % 2 or len(codes) > 10:
|
|
332
|
+
return None
|
|
333
|
+
wins = draws = losses = 0
|
|
334
|
+
for first, second in zip(codes[::2], codes[1::2]):
|
|
335
|
+
if (first, second) == (-1, 0):
|
|
336
|
+
draws += 1
|
|
337
|
+
elif first in (0, 1) and second in (0, 1):
|
|
338
|
+
if first == second:
|
|
339
|
+
wins += 1
|
|
340
|
+
else:
|
|
341
|
+
losses += 1
|
|
342
|
+
else:
|
|
343
|
+
return None
|
|
344
|
+
return wins, draws, losses
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
def _history_matches_outcomes(
|
|
348
|
+
recent: tuple[int, int, int], matches: int, wins: int, draws: int, losses: int,
|
|
349
|
+
) -> bool:
|
|
350
|
+
"""A full short history is exact; a recent window gives component bounds."""
|
|
351
|
+
if sum(recent) != min(matches, 5):
|
|
352
|
+
return False
|
|
353
|
+
lifetime = (wins, draws, losses)
|
|
354
|
+
return recent == lifetime if matches <= 5 else all(
|
|
355
|
+
observed <= total for observed, total in zip(recent, lifetime)
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
|
|
325
359
|
def _rich_layout_for(
|
|
326
360
|
family: DiscoveredSolareFamily,
|
|
327
361
|
) -> Optional[_RichDetailLayout]:
|
|
@@ -514,6 +548,14 @@ def _decode_performance_slots(
|
|
|
514
548
|
or not history_raw
|
|
515
549
|
):
|
|
516
550
|
return None
|
|
551
|
+
if -1 in history_codes:
|
|
552
|
+
# Signed histories have observed pair semantics. Keep legacy binary
|
|
553
|
+
# registered decoding unchanged, but never publish a contradictory draw.
|
|
554
|
+
recent = _history_outcome_counts(history_codes)
|
|
555
|
+
if recent is None or not _history_matches_outcomes(
|
|
556
|
+
recent, slot_matches, slot_wins, slot_draws, slot_losses,
|
|
557
|
+
):
|
|
558
|
+
return None
|
|
517
559
|
occupied_codes.add(class_code)
|
|
518
560
|
|
|
519
561
|
gear_loadout_raw: Optional[SolareRawSection] = None
|
|
@@ -204,7 +204,8 @@ def _read_player_identifier(data: bytes, offset: int, max_chars: int = 32) -> st
|
|
|
204
204
|
return data[offset:position].decode("utf-16-le")
|
|
205
205
|
if not _is_player_identifier_codepoint(code):
|
|
206
206
|
return ""
|
|
207
|
-
if position == offset and unicodedata.category(chr(code)).startswith("M")
|
|
207
|
+
if (position == offset and unicodedata.category(chr(code)).startswith("M")
|
|
208
|
+
and not 0x0E48 <= code <= 0x0E4B):
|
|
208
209
|
return ""
|
|
209
210
|
if (0xFE00 <= code <= 0xFE0F or 0xE0100 <= code <= 0xE01EF) and not (
|
|
210
211
|
unicodedata.name(chr(previous_code), "").startswith(
|
|
@@ -154,6 +154,7 @@ tests/test_remote_profiles.py
|
|
|
154
154
|
tests/test_solare_api.py
|
|
155
155
|
tests/test_solare_details.py
|
|
156
156
|
tests/test_solare_equipment.py
|
|
157
|
+
tests/test_solare_history.py
|
|
157
158
|
tests/test_solare_learning.py
|
|
158
159
|
tests/test_solare_learning_adversarial.py
|
|
159
160
|
tests/test_solare_real_captures.py
|
|
@@ -19,6 +19,44 @@ _HISTORY_SIZE = 0x65
|
|
|
19
19
|
_FLOW = FlowKey("198.51.100.10", 8889, "192.0.2.25", 50000)
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
@pytest.mark.parametrize('role', ('rich', 'overall'))
|
|
23
|
+
@pytest.mark.parametrize('matches', (5, 81))
|
|
24
|
+
@pytest.mark.parametrize('damage', (None, 'draw_as_loss', 'unknown_pair', 'odd_signed'))
|
|
25
|
+
def test_registered_history_accepts_observed_draw_and_rejects_contradictions(role, matches, damage):
|
|
26
|
+
layout = _REPRESENTATIVE_LAYOUT
|
|
27
|
+
synthetic = _synthetic_snapshot(layout)
|
|
28
|
+
frames = synthetic.rich_frames if role == 'rich' else synthetic.overall_frames
|
|
29
|
+
prefix = '' if role == 'rich' else 'overall_'
|
|
30
|
+
message = bytearray(frames[0].message)
|
|
31
|
+
wins, draws, losses = (2,1,2) if matches == 5 else (43,1,37)
|
|
32
|
+
if damage == 'draw_as_loss':
|
|
33
|
+
draws, losses = 0, losses+1
|
|
34
|
+
for key,value in (('matches',matches),('wins',wins),('draws',draws),('losses',losses)):
|
|
35
|
+
_put_u32(message,getattr(layout,prefix+key),value)
|
|
36
|
+
wire = '0,1,1,0,1,1,1,1,-1,0'
|
|
37
|
+
if damage == 'unknown_pair': wire = wire[:-1] + '1'
|
|
38
|
+
if damage == 'odd_signed': wire += ',1'
|
|
39
|
+
_write_history(message,getattr(layout,prefix+'history'),wire)
|
|
40
|
+
changed = (replace(frames[0],message=bytes(message)), *frames[1:])
|
|
41
|
+
if role == 'rich':
|
|
42
|
+
decoded = decode_solare_details(changed,synthetic.rich)
|
|
43
|
+
if damage:
|
|
44
|
+
assert decoded is None
|
|
45
|
+
return
|
|
46
|
+
entries = decoded.players
|
|
47
|
+
else:
|
|
48
|
+
decoded = decode_solare_overall_details(changed,synthetic.overall)
|
|
49
|
+
assert decoded is not None and 'aggregate_performance' in decoded.capabilities
|
|
50
|
+
if damage:
|
|
51
|
+
assert 'performance' not in decoded.capabilities
|
|
52
|
+
return
|
|
53
|
+
entries = decoded.entries
|
|
54
|
+
performance = entries[0].classes_played[0]
|
|
55
|
+
assert performance.recent_results_wire_text == wire
|
|
56
|
+
assert performance.recent_results_raw[-2:] == (-1,0)
|
|
57
|
+
assert (performance.matches,performance.wins,performance.draws,performance.losses) == (matches,wins,draws,losses)
|
|
58
|
+
|
|
59
|
+
|
|
22
60
|
@dataclass(frozen=True)
|
|
23
61
|
class _Layout:
|
|
24
62
|
layout_id: str
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""Observed recent-draw encoding, bounds, and outcome-orientation regressions."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
from bdo_toolkit.solare._details import (
|
|
7
|
+
_decode_history_region, _history_outcome_counts, _history_matches_outcomes,
|
|
8
|
+
)
|
|
9
|
+
from bdo_toolkit.solare._detail_learning import _history_outcome_candidates, _orient_outcomes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@pytest.mark.parametrize("wire,counts", (
|
|
13
|
+
("-1,0", (0, 1, 0)),
|
|
14
|
+
("0,1,1,0,1,1,1,1,-1,0", (2, 1, 2)),
|
|
15
|
+
("-1,0,0,0,0,1", (1, 1, 1)),
|
|
16
|
+
("1,0,-1,0,1,1", (1, 1, 1)),
|
|
17
|
+
(",".join(["-1,0"] * 5), (0, 5, 0)),
|
|
18
|
+
))
|
|
19
|
+
def test_draw_history_preserves_exact_signed_wire_values(wire, counts):
|
|
20
|
+
decoded = _decode_history_region(wire.encode() + bytes(101-len(wire)))
|
|
21
|
+
assert decoded == (wire, tuple(map(int, wire.split(','))))
|
|
22
|
+
assert _history_outcome_counts(decoded[1]) == counts
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@pytest.mark.parametrize("wire", (
|
|
26
|
+
b"-1", b"-1,1", b"0,-1", b"1,-1", b"-1,-1", b"-2,0",
|
|
27
|
+
b"2,0", b"-01,0", b"+1,0", b"-1,0,1", b"-1,0,", b"-1,,0",
|
|
28
|
+
b" -1,0", b"-1, 0", b"\xff,0", b",".join([b"-1,0"]*6),
|
|
29
|
+
))
|
|
30
|
+
def test_unobserved_or_malformed_signed_history_is_rejected(wire):
|
|
31
|
+
assert _decode_history_region(wire + b'\0') is None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_history_keeps_legacy_opaque_binary_and_empty_behavior():
|
|
35
|
+
assert _decode_history_region(b'1,0,1\0') == ('1,0,1', (1,0,1))
|
|
36
|
+
assert _history_outcome_counts((1,0,1)) is None
|
|
37
|
+
assert _decode_history_region(b'\0stale inactive bytes') == ('', ())
|
|
38
|
+
assert _decode_history_region(b'-1,0') is None
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _row(wins, draws, losses, *, older_wins=0):
|
|
42
|
+
row = bytearray(160)
|
|
43
|
+
pairs = [(1,1)]*wins + [(-1,0)]*draws + [(0,1)]*losses
|
|
44
|
+
wire = ','.join(str(v) for pair in pairs for v in pair).encode()
|
|
45
|
+
for offset,value in ((0,wins+draws+losses+older_wins),
|
|
46
|
+
(12,wins+older_wins),(24,draws),(36,losses)):
|
|
47
|
+
row[offset:offset+4] = value.to_bytes(4,'little')
|
|
48
|
+
row[48:48+len(wire)] = wire
|
|
49
|
+
return bytes(row)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@pytest.mark.parametrize('matches', range(1,6))
|
|
53
|
+
def test_complete_short_history_with_draw_supports_exact_counters(matches):
|
|
54
|
+
wins = max(0,matches-2)
|
|
55
|
+
row = _row(wins,1,matches-wins-1)
|
|
56
|
+
candidates = _history_outcome_candidates((row,), (1,), 0, (12,24,36), 48,
|
|
57
|
+
minimum_discriminators=0)
|
|
58
|
+
assert (12,24,36) in candidates
|
|
59
|
+
assert _history_matches_outcomes((wins,1,matches-wins-1),matches,wins,1,matches-wins-1)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@pytest.mark.parametrize('older_wins', (0,10))
|
|
63
|
+
def test_draw_histories_independently_orient_complete_and_long_records(older_wins):
|
|
64
|
+
rows = tuple(_row(w,d,l,older_wins=older_wins)
|
|
65
|
+
for w,d,l in ((3,1,1),(1,2,2),(1,3,1),(2,1,2),(0,1,4),(4,1,0)))
|
|
66
|
+
assert _orient_outcomes(rows,(1,)*len(rows),0,(12,24,36),48) == (12,24,36)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@pytest.mark.parametrize('older_wins', (0,10))
|
|
70
|
+
def test_recent_draw_cannot_be_counted_as_lifetime_loss(older_wins):
|
|
71
|
+
row = bytearray(_row(2,1,2,older_wins=older_wins))
|
|
72
|
+
row[24:28] = bytes(4)
|
|
73
|
+
row[36:40] = (3).to_bytes(4,'little') # Arithmetic still balances.
|
|
74
|
+
candidates = _history_outcome_candidates((bytes(row),),(1,),0,(12,24,36),48,
|
|
75
|
+
minimum_discriminators=0)
|
|
76
|
+
assert (12,24,36) not in candidates
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def test_recent_counts_require_each_lifetime_component_and_complete_window():
|
|
80
|
+
assert _history_matches_outcomes((2,1,2),81,43,1,37)
|
|
81
|
+
for lifetime in ((1,1,79),(43,0,38),(79,1,1)):
|
|
82
|
+
assert not _history_matches_outcomes((2,1,2),81,*lifetime)
|
|
83
|
+
assert not _history_matches_outcomes((2,1,1),81,43,1,37)
|
|
84
|
+
assert not _history_matches_outcomes((2,1,2),5,1,2,2)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def test_tied_binary_windows_do_not_weaken_existing_witness_minimum():
|
|
88
|
+
rows = tuple(_row(w,d,l) for w,d,l in (
|
|
89
|
+
(3,0,1),(1,0,3),(4,0,1),(1,0,4),(2,0,2),(2,0,2),(2,0,2)))
|
|
90
|
+
assert _history_outcome_candidates(rows,(1,)*7,0,(12,24,36),48,
|
|
91
|
+
minimum_discriminators=0) == ((12,24,36),)
|
|
92
|
+
assert _orient_outcomes(rows,(1,)*7,0,(12,24,36),48) is None
|
|
@@ -54,6 +54,9 @@ _JULY_30_UNKNOWN_LAYOUT_CAPTURE = (
|
|
|
54
54
|
_KR_OCTOBER_21_CAPTURE = optional_fixture_path(
|
|
55
55
|
'solare--leaderboard-complete-kr-post-patch--9731c37014')
|
|
56
56
|
|
|
57
|
+
_EU_RECENT_DRAW_CAPTURE = optional_fixture_path(
|
|
58
|
+
'solare--leaderboard-eu-recent-draw--030a695def')
|
|
59
|
+
|
|
57
60
|
_LEARNED_CAPABILITIES = frozenset(
|
|
58
61
|
{"rankings", "elo", "performance", "raw_extensions", "equipment"}
|
|
59
62
|
)
|
|
@@ -68,6 +71,37 @@ class _ReplayPair:
|
|
|
68
71
|
learned: SolareCaptureResult
|
|
69
72
|
|
|
70
73
|
|
|
74
|
+
def test_eu_recent_draw_capture_recovers_all_details():
|
|
75
|
+
if not _EU_RECENT_DRAW_CAPTURE.is_file():
|
|
76
|
+
pytest.skip('private EU recent-draw capture is not installed')
|
|
77
|
+
result = replay_solare(_EU_RECENT_DRAW_CAPTURE,retain_raw_extensions=True)
|
|
78
|
+
assert result.complete and result.evidence.health.capture_is_clean
|
|
79
|
+
assert result.evidence.exact_cross_check == 100
|
|
80
|
+
snapshot = result.snapshot
|
|
81
|
+
assert snapshot is not None and len(snapshot.players) == 640
|
|
82
|
+
assert len(snapshot.overall_top_100) == 100
|
|
83
|
+
assert _LEARNED_CAPABILITIES - {'raw_extensions'} <= snapshot.class_table_capabilities
|
|
84
|
+
assert _LEARNED_OVERALL_CAPABILITIES - {'raw_extensions'} <= snapshot.overall_capabilities
|
|
85
|
+
by_rank = {p.global_rank:p for p in snapshot.players}
|
|
86
|
+
recent = by_rank[513].classes_played[0]
|
|
87
|
+
assert by_rank[513].elo == 1424 and recent.player_class.code == 34
|
|
88
|
+
assert (recent.matches,recent.wins,recent.draws,recent.losses) == (81,43,1,37)
|
|
89
|
+
assert recent.recent_results_wire_text == '0,1,1,0,1,1,1,1,-1,0'
|
|
90
|
+
assert recent.recent_results_raw[-2:] == (-1,0)
|
|
91
|
+
older = by_rank[1034].classes_played[0]
|
|
92
|
+
assert (older.matches,older.wins,older.draws,older.losses) == (241,108,1,132)
|
|
93
|
+
assert -1 not in older.recent_results_raw
|
|
94
|
+
for player in (*snapshot.players,*snapshot.overall_top_100):
|
|
95
|
+
for slot in player.classes_played:
|
|
96
|
+
assert slot.record_is_balanced and slot.equipment is not None
|
|
97
|
+
assert len(slot.equipment) == 14
|
|
98
|
+
for overall in snapshot.overall_top_100:
|
|
99
|
+
rich = by_rank[overall.global_rank]
|
|
100
|
+
for left,right in zip(overall.classes_played,rich.classes_played):
|
|
101
|
+
assert (left.matches,left.wins,left.draws,left.losses,left.equipment) == (
|
|
102
|
+
right.matches,right.wins,right.draws,right.losses,right.equipment)
|
|
103
|
+
|
|
104
|
+
|
|
71
105
|
def test_kr_capture_recovers_equivalent_zero_outcomes_and_direct_aggregates() -> None:
|
|
72
106
|
if not _KR_OCTOBER_21_CAPTURE.is_file():
|
|
73
107
|
pytest.skip("private October 21 KR capture is not installed")
|
|
@@ -508,13 +542,8 @@ def test_historical_rediscovery_without_low_match_history(path):
|
|
|
508
542
|
(baseline.snapshot.players, result.snapshot.players, result.snapshot.class_table_capabilities),
|
|
509
543
|
(baseline.snapshot.overall_top_100, result.snapshot.overall_top_100, result.snapshot.overall_capabilities),
|
|
510
544
|
):
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
# short histories. Preserve rankings, never invent outcome labels.
|
|
514
|
-
assert caps == frozenset({"rankings", "elo"})
|
|
515
|
-
assert [(p.name, p.global_rank) for p in after] == [(p.name, p.global_rank) for p in before]
|
|
516
|
-
assert all(not p.classes_played for p in after)
|
|
517
|
-
continue
|
|
545
|
+
# With observed draw-pair semantics, the season-start alternative that
|
|
546
|
+
# treated recent losses as lifetime draws is now contradicted too.
|
|
518
547
|
assert "performance" in caps
|
|
519
548
|
reference = {p.name: p for p in before}
|
|
520
549
|
for player in after:
|
|
@@ -972,3 +972,48 @@ def test_zero_aggregate_requires_independent_header_and_counter_proof(damage):
|
|
|
972
972
|
rows[-1] = bytes(row)
|
|
973
973
|
assert learning._learn_aggregate(replace(table, rows=tuple(rows)), perf,
|
|
974
974
|
companion=companion) is None
|
|
975
|
+
|
|
976
|
+
@pytest.mark.parametrize("damage", (None, "counter", "rank", "class", "few_shared", "ambiguous_source"))
|
|
977
|
+
def test_unoriented_counter_geometry_requires_independent_exact_joins(damage):
|
|
978
|
+
source, performance = _performance_rows(duplicate_counters=damage == "ambiguous_source")
|
|
979
|
+
source = _table(source.rows * 2)
|
|
980
|
+
occupied = performance.occupancies * 2
|
|
981
|
+
target = _table(source.rows)
|
|
982
|
+
if damage == "counter":
|
|
983
|
+
row = bytearray(target.rows[0])
|
|
984
|
+
row[performance.matches_offset] ^= 1
|
|
985
|
+
target = replace(target, rows=(bytes(row),) + target.rows[1:])
|
|
986
|
+
elif damage == "rank":
|
|
987
|
+
target = replace(target, ranks=(999,) + target.ranks[1:])
|
|
988
|
+
elif damage == "class":
|
|
989
|
+
row = bytearray(target.rows[0]); row[_CLASS_OFFSET] = 30
|
|
990
|
+
target = replace(target, rows=(bytes(row),) + target.rows[1:])
|
|
991
|
+
elif damage == "few_shared":
|
|
992
|
+
target = replace(target, names=tuple(n if i < 19 else "Other" + n for i, n in enumerate(target.names)))
|
|
993
|
+
check = learning._counter_geometry_check(
|
|
994
|
+
target, _CLASS_OFFSET, occupied, source, _CLASS_OFFSET, occupied,
|
|
995
|
+
)
|
|
996
|
+
if damage == "ambiguous_source":
|
|
997
|
+
assert check is None
|
|
998
|
+
else:
|
|
999
|
+
assert check is not None
|
|
1000
|
+
outcomes = (performance.losses_offset, performance.draws_offset, performance.wins_offset)
|
|
1001
|
+
assert check(performance.matches_offset, outcomes) is (damage is None)
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
def test_counter_solver_applies_evidence_before_rejecting_multiple_alignments():
|
|
1005
|
+
records, performance = _performance_rows(duplicate_counters=True)
|
|
1006
|
+
calls = []
|
|
1007
|
+
def validate(matches, outcomes):
|
|
1008
|
+
calls.append((matches, outcomes))
|
|
1009
|
+
return matches == performance.matches_offset and set(outcomes) == {
|
|
1010
|
+
performance.wins_offset, performance.draws_offset, performance.losses_offset,
|
|
1011
|
+
}
|
|
1012
|
+
result = learning._balanced_counter_solution(
|
|
1013
|
+
records.rows, performance.occupancies, validate=validate,
|
|
1014
|
+
)
|
|
1015
|
+
assert result is not None and result[0] == performance.matches_offset
|
|
1016
|
+
assert len(calls) > 1
|
|
1017
|
+
assert learning._balanced_counter_solution(
|
|
1018
|
+
records.rows, performance.occupancies, validate=lambda *args: True,
|
|
1019
|
+
) is None
|
|
@@ -344,7 +344,7 @@ def test_korean_name_reader_preserves_full_identifiers_and_rejects_suffixes(name
|
|
|
344
344
|
|
|
345
345
|
|
|
346
346
|
@pytest.mark.parametrize("prefix", (
|
|
347
|
-
"ผู้กล้า", "ひらがな", "カタカナ", "日本語", "简体汉字", "繁體漢字",
|
|
347
|
+
"\u0e48\u0e48Example", "\u0e49ไทย", "\u0e4bSample", "ผู้กล้า", "ひらがな", "カタカナ", "日本語", "简体汉字", "繁體漢字",
|
|
348
348
|
"𠮷野家", "ガ", "か\u3099", "葛\U000e0100", "KR한_ไทย漢カ",
|
|
349
349
|
))
|
|
350
350
|
def test_asian_script_names_confirm_complete_tables_without_normalization(prefix):
|
|
@@ -359,7 +359,7 @@ def test_asian_script_names_confirm_complete_tables_without_normalization(prefix
|
|
|
359
359
|
assert result.evidence.overall_layout.name_offset == 30
|
|
360
360
|
|
|
361
361
|
|
|
362
|
-
@pytest.mark.parametrize("name", ("ผู้กล้า", "𠮷野家", "葛\U000e0100", "か\u3099", "繁體汉字"))
|
|
362
|
+
@pytest.mark.parametrize("name", ("\u0e48\u0e48Example", "\u0e49ไทย", "\u0e4bSample", "ผู้กล้า", "𠮷野家", "葛\U000e0100", "か\u3099", "繁體汉字"))
|
|
363
363
|
def test_asian_name_readers_reject_every_suffix(name):
|
|
364
364
|
from bdo_toolkit.solare._details import _read_name
|
|
365
365
|
from bdo_toolkit.solare._discovery import _identifier_starts_here
|
|
@@ -371,7 +371,7 @@ def test_asian_name_readers_reject_every_suffix(name):
|
|
|
371
371
|
|
|
372
372
|
|
|
373
373
|
@pytest.mark.parametrize("name", (
|
|
374
|
-
"\u0e00", "\u0e3f", "\u3040", "\u30fb",
|
|
374
|
+
"\u0e00", "\u0e3f", "\u3040", "\u30fb",
|
|
375
375
|
"\u3099かな", "\u3000漢", "漢\u200b字", "A\ufe00", "A\U000e0100",
|
|
376
376
|
"\U0001f600", "\ue000", "𠮷" * 16, "ก" * 32,
|
|
377
377
|
))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|