Oracle and ledger#
The metered evaluator and the canonical evaluation ledger.
adda.get_evaluator(namespace: str | None = None, *, pending: bool = False) -> InstrumentedDataGenerator
#
The ONE door to a registered ground-truth oracle.
Locates run_config.json by walking up from Path.cwd() and reads
all configuration from it. The delegation id comes from
F3DASM_DELEGATION_ID, which the backend sets to the calling
delegation for every agent session; only when it is unset is it read
from the current folder's name (D###). So a delegation need not
cd into its folder.
The oracle is the source registered for this run, and its evaluations are written to the canonical store with provenance. There is no way to substitute an arbitrary inner generator or redirect the store — that is what makes ground-truth metering airtight. (Surrogates, stubs, and analysis are the agent's own DataGenerators, run freely off-ledger — never through here.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
namespace
|
str or None
|
The design namespace whose oracle + ledger to resolve. |
None
|
pending
|
bool
|
With the runtime knob |
False
|
Returns:
| Type | Description |
|---|---|
InstrumentedDataGenerator
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the cwd is not a |
FileNotFoundError
|
If |
Source code in src/adda/_src/evaluation/oracle_resolution.py
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | |
adda.LookupDataGenerator
#
Evaluate candidates by nearest-neighbour lookup against a fixed pool.
For every execute call the generator finds the pool row whose
normalised input vector is closest (L2 distance over min-max-scaled
coordinates) to the candidate and copies that row's output columns
onto the sample. The mechanism is the canonical Level-1 evaluator for
agentic-f3dasm — the agent never proposes coordinates that the pool
knows about ahead of time, but every proposal can be mapped to a pool
row deterministically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pool
|
ExperimentData
|
The pre-computed dataset to look up against. Must already carry finished output columns for every row. |
required |
input_columns
|
list of str
|
Names of the input columns (already present on every pool row) that contribute to the L2 distance. |
required |
output_columns
|
list of str
|
Names of the output columns to copy from the matched pool row.
If |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
pool |
ExperimentData
|
The pool the generator was constructed with (kept by reference for downstream introspection; never mutated). |
seen_indices |
set of int
|
Pool indices that have already been returned during this run; the
set is reset by :meth: |
Notes
The deep-copy of pool output data on every call guarantees that the
pool is never mutated by downstream code that edits the returned
sample. The generator deliberately does NOT raise on a repeated pool
hit — exhaustion of one region is not exhaustion of the search.
Strategies can poll :meth:consume_repeats after a batch to surface a
warning to the agent.
Source code in src/adda/_src/evaluation/lookup.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
pool = pool
instance-attribute
#
input_columns = list(input_columns)
instance-attribute
#
output_columns = None if output_columns is None else list(output_columns)
instance-attribute
#
_pool_indices: list[int] = list(pool.data.keys())
instance-attribute
#
_pool_inputs = pool_inputs
instance-attribute
#
_col_min = col_min
instance-attribute
#
_col_spread = spread
instance-attribute
#
_pool_normalised = (pool_inputs - col_min) / spread
instance-attribute
#
seen_indices: set[int] = set()
instance-attribute
#
_repeats: int = 0
instance-attribute
#
execute(experiment_sample: ExperimentSample, **kwargs) -> ExperimentSample
#
Look up the nearest pool row and copy its outputs onto the sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
experiment_sample
|
ExperimentSample
|
Sample whose input data carries values for every column in
:attr: |
required |
**kwargs
|
dict
|
Unused; present to match the ABC signature. |
{}
|
Returns:
| Type | Description |
|---|---|
ExperimentSample
|
The same sample object, with output data filled and the job status marked as finished. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the sample is missing one of the configured input columns. |
Source code in src/adda/_src/evaluation/lookup.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
consume_repeats() -> int
#
Return and reset the repeat counter.
Strategy adapters call this after a batch to surface a pool exhaustion warning to the agent.
Returns:
| Type | Description |
|---|---|
int
|
Number of times |
Source code in src/adda/_src/evaluation/lookup.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
reset_seen() -> None
#
Forget which pool indices have already been returned.
Useful for fresh runs that reuse the same pool instance.
Source code in src/adda/_src/evaluation/lookup.py
199 200 201 202 203 204 205 206 | |
adda.load_experiments(store_root: Path | str | None = None) -> dict[str, ExperimentData]
#
Load EVERY experiment store of a run as a dict {name: ExperimentData}.
A namespaced run holds one clean ExperimentData per experiment at nested
paths — the default store at <root>/experiment_data/ and each design
experiment at <root>/<name>/experiment_data/ — so a single
ExperimentData.from_file (the single-study idiom) loads only the default
store and silently misses the rest. This is the multi-namespace load idiom
for pipeline.ipynb: one call returns them all, keyed by experiment name
(the default/baseline store is "default").
store_root defaults to $F3DASM_CANONICAL_STORE (set in the notebook's
execution env), so the notebook body is just
experiments = load_experiments(). Empty/absent stores are skipped; an
empty run yields {}. Never raises on a missing store.
Source code in src/adda/_src/evaluation/ledger_summary.py
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | |