bdo-toolkit 1.0.0__py3-none-any.whl

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.
Files changed (48) hide show
  1. bdo_toolkit/__init__.py +87 -0
  2. bdo_toolkit/_async_sessions.py +651 -0
  3. bdo_toolkit/_capture_backend.py +194 -0
  4. bdo_toolkit/_capture_options.py +68 -0
  5. bdo_toolkit/_capture_runtime.py +626 -0
  6. bdo_toolkit/_deposit_origin.py +1599 -0
  7. bdo_toolkit/_engine.py +327 -0
  8. bdo_toolkit/_framing.py +904 -0
  9. bdo_toolkit/_profile_runtime.py +157 -0
  10. bdo_toolkit/_protocol.py +386 -0
  11. bdo_toolkit/_reassembly.py +654 -0
  12. bdo_toolkit/_specs.py +285 -0
  13. bdo_toolkit/_storage_destination_validation.py +167 -0
  14. bdo_toolkit/_storage_hydration.py +241 -0
  15. bdo_toolkit/_version.py +3 -0
  16. bdo_toolkit/calibration.py +3223 -0
  17. bdo_toolkit/capture.py +1713 -0
  18. bdo_toolkit/character_state.py +3506 -0
  19. bdo_toolkit/cli.py +948 -0
  20. bdo_toolkit/diagnostics.py +51 -0
  21. bdo_toolkit/events.py +214 -0
  22. bdo_toolkit/filters.py +105 -0
  23. bdo_toolkit/item_state.py +48 -0
  24. bdo_toolkit/origin_learning.py +779 -0
  25. bdo_toolkit/profiles.py +370 -0
  26. bdo_toolkit/py.typed +1 -0
  27. bdo_toolkit/remote_profiles.py +358 -0
  28. bdo_toolkit/solare/__init__.py +50 -0
  29. bdo_toolkit/solare/_constants.py +94 -0
  30. bdo_toolkit/solare/_detail_learning.py +1437 -0
  31. bdo_toolkit/solare/_details.py +796 -0
  32. bdo_toolkit/solare/_discovery.py +1212 -0
  33. bdo_toolkit/solare/_live_tracker.py +472 -0
  34. bdo_toolkit/solare/_replay_capture.py +182 -0
  35. bdo_toolkit/solare/_result.py +441 -0
  36. bdo_toolkit/solare/_scanner.py +203 -0
  37. bdo_toolkit/solare/_validation.py +11 -0
  38. bdo_toolkit/solare/async_session.py +444 -0
  39. bdo_toolkit/solare/models.py +806 -0
  40. bdo_toolkit/solare/replay.py +62 -0
  41. bdo_toolkit/solare/session.py +1051 -0
  42. bdo_toolkit/writers.py +30 -0
  43. bdo_toolkit-1.0.0.dist-info/METADATA +143 -0
  44. bdo_toolkit-1.0.0.dist-info/RECORD +48 -0
  45. bdo_toolkit-1.0.0.dist-info/WHEEL +5 -0
  46. bdo_toolkit-1.0.0.dist-info/entry_points.txt +2 -0
  47. bdo_toolkit-1.0.0.dist-info/licenses/LICENSE +21 -0
  48. bdo_toolkit-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,62 @@
1
+ """Public offline replay API for Arena of Solare leaderboard captures."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import Iterable
6
+ from pathlib import Path
7
+
8
+ from bdo_toolkit._capture_backend import iter_pcap_file
9
+ from bdo_toolkit._protocol import DEFAULT_SERVER_PORTS
10
+
11
+ from ._live_tracker import LiveSolareDiscoveryTracker
12
+ from ._replay_capture import SolareFrameCollector
13
+ from ._result import build_solare_result
14
+ from ._validation import validate_retain_raw_extensions
15
+ from .models import SolareCaptureResult
16
+
17
+
18
+ def replay_solare(
19
+ path: str | Path,
20
+ *,
21
+ ports: Iterable[int] = DEFAULT_SERVER_PORTS,
22
+ retain_raw_extensions: bool = False,
23
+ ) -> SolareCaptureResult:
24
+ """Replay a pcap/pcapng file and discover one Solare leaderboard snapshot.
25
+
26
+ Classification is based on the relationships among ranked, class-balanced,
27
+ and overall tables. Opcode values are retained only as diagnostic evidence
28
+ and are never supplied as classifier inputs.
29
+ """
30
+
31
+ retain_raw_extensions = validate_retain_raw_extensions(
32
+ retain_raw_extensions
33
+ )
34
+ tracker = LiveSolareDiscoveryTracker(lambda _update: None)
35
+ collector = SolareFrameCollector(
36
+ ports,
37
+ on_frame=tracker.observe,
38
+ retain_frames=False,
39
+ )
40
+ saved_packets = 0
41
+ for _ in iter_pcap_file(Path(path), collector):
42
+ saved_packets += 1
43
+ collector.finish()
44
+ tracker.refresh()
45
+ frames = tracker.confirmed_frames or tracker.retained_frames
46
+ return build_solare_result(
47
+ frames,
48
+ collector.health(
49
+ saved_packets=saved_packets,
50
+ retained_large_messages=tracker.observed_frame_count,
51
+ candidate_messages_observed=tracker.observed_frame_count,
52
+ candidate_frames_retained=tracker.retained_frame_count,
53
+ candidate_bytes_retained=tracker.retained_bytes,
54
+ peak_candidate_frames=tracker.peak_retained_frame_count,
55
+ peak_candidate_bytes=tracker.peak_retained_bytes,
56
+ candidate_frames_evicted=tracker.evicted_frame_count,
57
+ candidate_bytes_evicted=tracker.evicted_bytes,
58
+ candidate_history_rolled_over=tracker.history_rolled_over,
59
+ ),
60
+ retain_raw_extensions=retain_raw_extensions,
61
+ _discovery=tracker.result,
62
+ )