@vessel-dsp/compiler 0.0.0-stage → 0.3.0
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.
- package/README.md +118 -2
- package/dist/bake.d.ts +38 -0
- package/dist/bake.d.ts.map +1 -0
- package/dist/bake.js +101 -0
- package/dist/bake.js.map +1 -0
- package/dist/bbd-clock.d.ts +171 -0
- package/dist/bbd-clock.d.ts.map +1 -0
- package/dist/bbd-clock.js +1750 -0
- package/dist/bbd-clock.js.map +1 -0
- package/dist/block-row.d.ts +51 -0
- package/dist/block-row.d.ts.map +1 -0
- package/dist/block-row.js +17 -0
- package/dist/block-row.js.map +1 -0
- package/dist/bypass.d.ts +3 -0
- package/dist/bypass.d.ts.map +1 -0
- package/dist/bypass.js +228 -0
- package/dist/bypass.js.map +1 -0
- package/dist/compile.d.ts +24 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +348 -0
- package/dist/compile.js.map +1 -0
- package/dist/converter-scale.d.ts +14 -0
- package/dist/converter-scale.d.ts.map +1 -0
- package/dist/converter-scale.js +133 -0
- package/dist/converter-scale.js.map +1 -0
- package/dist/couple.d.ts +28 -0
- package/dist/couple.d.ts.map +1 -0
- package/dist/couple.js +567 -0
- package/dist/couple.js.map +1 -0
- package/dist/dangling-active-terminal.d.ts +47 -0
- package/dist/dangling-active-terminal.d.ts.map +1 -0
- package/dist/dangling-active-terminal.js +542 -0
- package/dist/dangling-active-terminal.js.map +1 -0
- package/dist/declared-program.d.ts +23 -0
- package/dist/declared-program.d.ts.map +1 -0
- package/dist/declared-program.js +387 -0
- package/dist/declared-program.js.map +1 -0
- package/dist/denomination.d.ts +48 -0
- package/dist/denomination.d.ts.map +1 -0
- package/dist/denomination.js +27 -0
- package/dist/denomination.js.map +1 -0
- package/dist/device-laws.d.ts +237 -0
- package/dist/device-laws.d.ts.map +1 -0
- package/dist/device-laws.js +3513 -0
- package/dist/device-laws.js.map +1 -0
- package/dist/diagnostics.d.ts +13 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +19 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/emit.d.ts +8 -0
- package/dist/emit.d.ts.map +1 -0
- package/dist/emit.js +43 -0
- package/dist/emit.js.map +1 -0
- package/dist/errors.d.ts +22 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +39 -0
- package/dist/errors.js.map +1 -0
- package/dist/firmware-class.d.ts +69 -0
- package/dist/firmware-class.d.ts.map +1 -0
- package/dist/firmware-class.js +20 -0
- package/dist/firmware-class.js.map +1 -0
- package/dist/fixtures/circuits.d.ts +1742 -0
- package/dist/fixtures/circuits.d.ts.map +1 -0
- package/dist/fixtures/circuits.js +13896 -0
- package/dist/fixtures/circuits.js.map +1 -0
- package/dist/fixtures/expected.d.ts +261 -0
- package/dist/fixtures/expected.d.ts.map +1 -0
- package/dist/fixtures/expected.js +315 -0
- package/dist/fixtures/expected.js.map +1 -0
- package/dist/fixtures/index.d.ts +4 -0
- package/dist/fixtures/index.d.ts.map +1 -0
- package/dist/fixtures/index.js +8 -0
- package/dist/fixtures/index.js.map +1 -0
- package/dist/fixtures/registry.d.ts +52 -0
- package/dist/fixtures/registry.d.ts.map +1 -0
- package/dist/fixtures/registry.js +341 -0
- package/dist/fixtures/registry.js.map +1 -0
- package/dist/generic-tube-fit.d.ts +12 -0
- package/dist/generic-tube-fit.d.ts.map +1 -0
- package/dist/generic-tube-fit.js +45 -0
- package/dist/generic-tube-fit.js.map +1 -0
- package/dist/grounded-clock-supply.d.ts +13 -0
- package/dist/grounded-clock-supply.d.ts.map +1 -0
- package/dist/grounded-clock-supply.js +45 -0
- package/dist/grounded-clock-supply.js.map +1 -0
- package/dist/identify.d.ts +50 -0
- package/dist/identify.d.ts.map +1 -0
- package/dist/identify.js +319 -0
- package/dist/identify.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/inert-controls.d.ts +15 -0
- package/dist/inert-controls.d.ts.map +1 -0
- package/dist/inert-controls.js +266 -0
- package/dist/inert-controls.js.map +1 -0
- package/dist/latch-seed.d.ts +53 -0
- package/dist/latch-seed.d.ts.map +1 -0
- package/dist/latch-seed.js +257 -0
- package/dist/latch-seed.js.map +1 -0
- package/dist/link.d.ts +7 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +270 -0
- package/dist/link.js.map +1 -0
- package/dist/lower.d.ts +79 -0
- package/dist/lower.d.ts.map +1 -0
- package/dist/lower.js +1855 -0
- package/dist/lower.js.map +1 -0
- package/dist/netlist.d.ts +79 -0
- package/dist/netlist.d.ts.map +1 -0
- package/dist/netlist.js +4746 -0
- package/dist/netlist.js.map +1 -0
- package/dist/non-executable-clock-drivers.d.ts +8 -0
- package/dist/non-executable-clock-drivers.d.ts.map +1 -0
- package/dist/non-executable-clock-drivers.js +33 -0
- package/dist/non-executable-clock-drivers.js.map +1 -0
- package/dist/open-category.d.ts +98 -0
- package/dist/open-category.d.ts.map +1 -0
- package/dist/open-category.js +111 -0
- package/dist/open-category.js.map +1 -0
- package/dist/over-driven-node.d.ts +33 -0
- package/dist/over-driven-node.d.ts.map +1 -0
- package/dist/over-driven-node.js +188 -0
- package/dist/over-driven-node.js.map +1 -0
- package/dist/part-catalog.d.ts +15 -0
- package/dist/part-catalog.d.ts.map +1 -0
- package/dist/part-catalog.js +6712 -0
- package/dist/part-catalog.js.map +1 -0
- package/dist/part-number.d.ts +32 -0
- package/dist/part-number.d.ts.map +1 -0
- package/dist/part-number.js +80 -0
- package/dist/part-number.js.map +1 -0
- package/dist/partition.d.ts +7 -0
- package/dist/partition.d.ts.map +1 -0
- package/dist/partition.js +242 -0
- package/dist/partition.js.map +1 -0
- package/dist/port-full-scale.d.ts +70 -0
- package/dist/port-full-scale.d.ts.map +1 -0
- package/dist/port-full-scale.js +235 -0
- package/dist/port-full-scale.js.map +1 -0
- package/dist/pot-orientation.d.ts +114 -0
- package/dist/pot-orientation.d.ts.map +1 -0
- package/dist/pot-orientation.js +551 -0
- package/dist/pot-orientation.js.map +1 -0
- package/dist/power-domain-control.d.ts +40 -0
- package/dist/power-domain-control.d.ts.map +1 -0
- package/dist/power-domain-control.js +142 -0
- package/dist/power-domain-control.js.map +1 -0
- package/dist/proxy-declaration.d.ts +121 -0
- package/dist/proxy-declaration.d.ts.map +1 -0
- package/dist/proxy-declaration.js +50 -0
- package/dist/proxy-declaration.js.map +1 -0
- package/dist/registry.d.ts +323 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +192 -0
- package/dist/registry.js.map +1 -0
- package/dist/sparse-schedule.d.ts +65 -0
- package/dist/sparse-schedule.d.ts.map +1 -0
- package/dist/sparse-schedule.js +421 -0
- package/dist/sparse-schedule.js.map +1 -0
- package/dist/speaker-load.d.ts +38 -0
- package/dist/speaker-load.d.ts.map +1 -0
- package/dist/speaker-load.js +97 -0
- package/dist/speaker-load.js.map +1 -0
- package/dist/stage-coverage.d.ts +21 -0
- package/dist/stage-coverage.d.ts.map +1 -0
- package/dist/stage-coverage.js +124 -0
- package/dist/stage-coverage.js.map +1 -0
- package/dist/stamp-partition.d.ts +314 -0
- package/dist/stamp-partition.d.ts.map +1 -0
- package/dist/stamp-partition.js +472 -0
- package/dist/stamp-partition.js.map +1 -0
- package/dist/supply-reference.d.ts +19 -0
- package/dist/supply-reference.d.ts.map +1 -0
- package/dist/supply-reference.js +66 -0
- package/dist/supply-reference.js.map +1 -0
- package/dist/supply-short.d.ts +32 -0
- package/dist/supply-short.d.ts.map +1 -0
- package/dist/supply-short.js +118 -0
- package/dist/supply-short.js.map +1 -0
- package/dist/supply-stamps.d.ts +51 -0
- package/dist/supply-stamps.d.ts.map +1 -0
- package/dist/supply-stamps.js +363 -0
- package/dist/supply-stamps.js.map +1 -0
- package/dist/terminal-role.d.ts +109 -0
- package/dist/terminal-role.d.ts.map +1 -0
- package/dist/terminal-role.js +46 -0
- package/dist/terminal-role.js.map +1 -0
- package/dist/terminal-roles.d.ts +59 -0
- package/dist/terminal-roles.d.ts.map +1 -0
- package/dist/terminal-roles.js +92 -0
- package/dist/terminal-roles.js.map +1 -0
- package/dist/transformer.d.ts +181 -0
- package/dist/transformer.d.ts.map +1 -0
- package/dist/transformer.js +476 -0
- package/dist/transformer.js.map +1 -0
- package/dist/types.d.ts +3157 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/dist/unbounded-operating-point.d.ts +35 -0
- package/dist/unbounded-operating-point.d.ts.map +1 -0
- package/dist/unbounded-operating-point.js +181 -0
- package/dist/unbounded-operating-point.js.map +1 -0
- package/dist/unexecuted-region.d.ts +3 -0
- package/dist/unexecuted-region.d.ts.map +1 -0
- package/dist/unexecuted-region.js +122 -0
- package/dist/unexecuted-region.js.map +1 -0
- package/dist/unimplemented-control-role.d.ts +3 -0
- package/dist/unimplemented-control-role.d.ts.map +1 -0
- package/dist/unimplemented-control-role.js +61 -0
- package/dist/unimplemented-control-role.js.map +1 -0
- package/dist/unreachable-output.d.ts +3 -0
- package/dist/unreachable-output.d.ts.map +1 -0
- package/dist/unreachable-output.js +97 -0
- package/dist/unreachable-output.js.map +1 -0
- package/dist/unreadable-terminal-role.d.ts +67 -0
- package/dist/unreadable-terminal-role.d.ts.map +1 -0
- package/dist/unreadable-terminal-role.js +409 -0
- package/dist/unreadable-terminal-role.js.map +1 -0
- package/dist/unverified-pinout.d.ts +27 -0
- package/dist/unverified-pinout.d.ts.map +1 -0
- package/dist/unverified-pinout.js +121 -0
- package/dist/unverified-pinout.js.map +1 -0
- package/package.json +75 -5
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type Block, type Ports } from "./types";
|
|
2
|
+
export type PortFullScaleVolts = {
|
|
3
|
+
readonly input: number | null;
|
|
4
|
+
readonly output: number | null;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Read from the lowered stamps rather than the declared devices, the same discipline
|
|
8
|
+
* `supply-reference.ts` uses and for the same reason: lowering is what collapses redundant
|
|
9
|
+
* supply declarations into one source, and the stamps are what the runtime executes.
|
|
10
|
+
*
|
|
11
|
+
* A transformer stamp is only consulted when it declares a `turnsRatio` **and** the output port
|
|
12
|
+
* sits on one of its secondary nodes. A mains transformer's windings are nodes too, and dividing
|
|
13
|
+
* by a power transformer's ratio would be arithmetic on an unrelated number.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Read from the lowered stamps rather than the declared devices, the same discipline
|
|
17
|
+
* `supply-reference.ts` uses and for the same reason: lowering is what collapses redundant
|
|
18
|
+
* supply declarations into one source, and the stamps are what the runtime executes.
|
|
19
|
+
*
|
|
20
|
+
* **Propagated from the supply rather than looked up at the port**, which is the correction of
|
|
21
|
+
* 2026-09-03. The previous rung kept a `Map<NodeId, factor>` written by every transformer stamp
|
|
22
|
+
* that touched a node, so the answer depended on write order and on whether a stamp related the
|
|
23
|
+
* port to the *supply* at all. Two defects followed, and both are measured:
|
|
24
|
+
*
|
|
25
|
+
* - A coil with two loaded taps stamps a winding between them, and that stamp related
|
|
26
|
+
* `orange-rockerverb`'s 16 Ω output to its 8 Ω sibling -- not to any supply. Written last, its
|
|
27
|
+
* `x1.4142` replaced the `x0.1372` plate step-down and the amp's bound became 580 V, above its
|
|
28
|
+
* own 410 V rail.
|
|
29
|
+
* - Nine of the 24 amps had **no** stamp on the output node and fell back to the bare rail:
|
|
30
|
+
* `marshall-jcm800` reported 466.7 V for a speaker terminal. Their speaker jack sits on an
|
|
31
|
+
* impedance selector's common, one 0.01 Ω throw away from the winding, and a direct node lookup
|
|
32
|
+
* cannot cross it.
|
|
33
|
+
*
|
|
34
|
+
* So this walks outward from the supply nodes: a transformer stamp multiplies by its ratio in the
|
|
35
|
+
* direction travelled, and a selector throw is a near-short that carries the bound across
|
|
36
|
+
* unchanged. **The largest bound reaching the port wins**, which is what makes it an upper bound
|
|
37
|
+
* rather than a nominal level -- a selector's throws are alternative taps and any of them may be
|
|
38
|
+
* the closed one, so the loosest is the one that has to hold.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Read from the lowered stamps rather than the declared devices, the same discipline
|
|
42
|
+
* `supply-reference.ts` uses and for the same reason: lowering is what collapses redundant
|
|
43
|
+
* supply declarations into one source, and the stamps are what the runtime executes.
|
|
44
|
+
*
|
|
45
|
+
* The composition is `maximum supply x the transformer factor at the port`. It is not a walk from
|
|
46
|
+
* the supply to the port: the B+ that drives an output transformer's plate winding arrives
|
|
47
|
+
* through a rectifier and a filter bank, so no transformer-only path connects the two --
|
|
48
|
+
* `fender-5f1-champ`'s speaker node is reachable from its 410 V winding only through its 5Y3 and
|
|
49
|
+
* two 16 uF caps. Tried and measured: a propagation reached the port on nothing.
|
|
50
|
+
*
|
|
51
|
+
* **Two corrections, 2026-09-03**, both from measuring all 24 corpus amps:
|
|
52
|
+
*
|
|
53
|
+
* - **The port may sit one near-short away from the winding.** Nine amps reported their bare rail
|
|
54
|
+
* for a speaker terminal -- `marshall-jcm800` 466.7 V -- because their speaker jack sits on an
|
|
55
|
+
* impedance selector's *common* and a direct node lookup cannot cross a 0.01 ohm throw. The
|
|
56
|
+
* port's winding node is now found through selector and switch links.
|
|
57
|
+
* - **The smallest factor at that node wins.** A coil with two loaded taps stamps a winding
|
|
58
|
+
* between them, and that stamp relates `orange-rockerverb`'s 16 ohm output to its 8 ohm sibling
|
|
59
|
+
* rather than to any supply. Kept in a map written per stamp it replaced the plate step-down by
|
|
60
|
+
* write order and the amp's bound became 580 V, above its own 410 V rail. Every stamp touching
|
|
61
|
+
* the node constrains it at once, so the tightest is the one that has to hold.
|
|
62
|
+
*
|
|
63
|
+
* The residual: a sibling-tap stamp whose factor happened to be *smaller* than the plate
|
|
64
|
+
* step-down would be chosen and would under-report the bound, making a render louder rather
|
|
65
|
+
* than quieter. No corpus coil is shaped that way -- a tap-to-tap ratio is within a factor of
|
|
66
|
+
* two of one, and a plate-to-speaker ratio is 10x to 40x down.
|
|
67
|
+
*/
|
|
68
|
+
export declare function portFullScaleVolts(blocks: readonly Block[], ports?: Ports): PortFullScaleVolts;
|
|
69
|
+
export declare function deriveFullScaleVolts(supplyVolts: number | null, turnsRatio: number | null): number | null;
|
|
70
|
+
//# sourceMappingURL=port-full-scale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port-full-scale.d.ts","sourceRoot":"","sources":["../src/port-full-scale.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,KAAK,EAAuB,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAEtE,MAAM,MAAM,kBAAkB,GAAG;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF;;;;;;;;GAQG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,KAAK,CAAC,EAAE,KAAK,GACX,kBAAkB,CA8GpB;AA2CD,wBAAgB,oBAAoB,CACnC,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,GACvB,MAAM,GAAG,IAAI,CAQf"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// The largest voltage a port can physically present, so a chain can compare two blocks.
|
|
2
|
+
//
|
|
3
|
+
// `ChainRuntime` hands one slot's output straight to the next as a bare number. That works for
|
|
4
|
+
// pedal-into-pedal only because their ranges coincide: a pedal's output is the voltage at its
|
|
5
|
+
// output jack, ~0.1 to 2 V, while an amp's is the voltage at its speaker terminal --
|
|
6
|
+
// `fender-5e3-deluxe-tweed` measures 7.08 V into its 8 ohm load. Feed one into the other and the
|
|
7
|
+
// level is wrong by an order of magnitude, and nothing in the program said what either number
|
|
8
|
+
// meant.
|
|
9
|
+
//
|
|
10
|
+
// **An upper bound, not a nominal level.** A node cannot swing beyond the rails feeding it, and
|
|
11
|
+
// an output transformer steps that bound down by its turns ratio. Both facts are already in the
|
|
12
|
+
// program, so this needs no new source declaration -- which matters, because the corpus does not
|
|
13
|
+
// carry one: 31 amp jacks declare `V0dBFS` and every one of them is a monitor tap, no typed
|
|
14
|
+
// speaker load declares it, and rated output power appears once in 24 amp packets.
|
|
15
|
+
//
|
|
16
|
+
// **`null` where it is not derivable**, and the chain then scales by 1 and says so. A fabricated
|
|
17
|
+
// default here would be exactly the silent substitution this repository refuses elsewhere: it
|
|
18
|
+
// would look like a level convention while being a guess.
|
|
19
|
+
import { GROUND } from "./types.js";
|
|
20
|
+
/**
|
|
21
|
+
* Read from the lowered stamps rather than the declared devices, the same discipline
|
|
22
|
+
* `supply-reference.ts` uses and for the same reason: lowering is what collapses redundant
|
|
23
|
+
* supply declarations into one source, and the stamps are what the runtime executes.
|
|
24
|
+
*
|
|
25
|
+
* A transformer stamp is only consulted when it declares a `turnsRatio` **and** the output port
|
|
26
|
+
* sits on one of its secondary nodes. A mains transformer's windings are nodes too, and dividing
|
|
27
|
+
* by a power transformer's ratio would be arithmetic on an unrelated number.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Read from the lowered stamps rather than the declared devices, the same discipline
|
|
31
|
+
* `supply-reference.ts` uses and for the same reason: lowering is what collapses redundant
|
|
32
|
+
* supply declarations into one source, and the stamps are what the runtime executes.
|
|
33
|
+
*
|
|
34
|
+
* **Propagated from the supply rather than looked up at the port**, which is the correction of
|
|
35
|
+
* 2026-09-03. The previous rung kept a `Map<NodeId, factor>` written by every transformer stamp
|
|
36
|
+
* that touched a node, so the answer depended on write order and on whether a stamp related the
|
|
37
|
+
* port to the *supply* at all. Two defects followed, and both are measured:
|
|
38
|
+
*
|
|
39
|
+
* - A coil with two loaded taps stamps a winding between them, and that stamp related
|
|
40
|
+
* `orange-rockerverb`'s 16 Ω output to its 8 Ω sibling -- not to any supply. Written last, its
|
|
41
|
+
* `x1.4142` replaced the `x0.1372` plate step-down and the amp's bound became 580 V, above its
|
|
42
|
+
* own 410 V rail.
|
|
43
|
+
* - Nine of the 24 amps had **no** stamp on the output node and fell back to the bare rail:
|
|
44
|
+
* `marshall-jcm800` reported 466.7 V for a speaker terminal. Their speaker jack sits on an
|
|
45
|
+
* impedance selector's common, one 0.01 Ω throw away from the winding, and a direct node lookup
|
|
46
|
+
* cannot cross it.
|
|
47
|
+
*
|
|
48
|
+
* So this walks outward from the supply nodes: a transformer stamp multiplies by its ratio in the
|
|
49
|
+
* direction travelled, and a selector throw is a near-short that carries the bound across
|
|
50
|
+
* unchanged. **The largest bound reaching the port wins**, which is what makes it an upper bound
|
|
51
|
+
* rather than a nominal level -- a selector's throws are alternative taps and any of them may be
|
|
52
|
+
* the closed one, so the loosest is the one that has to hold.
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* Read from the lowered stamps rather than the declared devices, the same discipline
|
|
56
|
+
* `supply-reference.ts` uses and for the same reason: lowering is what collapses redundant
|
|
57
|
+
* supply declarations into one source, and the stamps are what the runtime executes.
|
|
58
|
+
*
|
|
59
|
+
* The composition is `maximum supply x the transformer factor at the port`. It is not a walk from
|
|
60
|
+
* the supply to the port: the B+ that drives an output transformer's plate winding arrives
|
|
61
|
+
* through a rectifier and a filter bank, so no transformer-only path connects the two --
|
|
62
|
+
* `fender-5f1-champ`'s speaker node is reachable from its 410 V winding only through its 5Y3 and
|
|
63
|
+
* two 16 uF caps. Tried and measured: a propagation reached the port on nothing.
|
|
64
|
+
*
|
|
65
|
+
* **Two corrections, 2026-09-03**, both from measuring all 24 corpus amps:
|
|
66
|
+
*
|
|
67
|
+
* - **The port may sit one near-short away from the winding.** Nine amps reported their bare rail
|
|
68
|
+
* for a speaker terminal -- `marshall-jcm800` 466.7 V -- because their speaker jack sits on an
|
|
69
|
+
* impedance selector's *common* and a direct node lookup cannot cross a 0.01 ohm throw. The
|
|
70
|
+
* port's winding node is now found through selector and switch links.
|
|
71
|
+
* - **The smallest factor at that node wins.** A coil with two loaded taps stamps a winding
|
|
72
|
+
* between them, and that stamp relates `orange-rockerverb`'s 16 ohm output to its 8 ohm sibling
|
|
73
|
+
* rather than to any supply. Kept in a map written per stamp it replaced the plate step-down by
|
|
74
|
+
* write order and the amp's bound became 580 V, above its own 410 V rail. Every stamp touching
|
|
75
|
+
* the node constrains it at once, so the tightest is the one that has to hold.
|
|
76
|
+
*
|
|
77
|
+
* The residual: a sibling-tap stamp whose factor happened to be *smaller* than the plate
|
|
78
|
+
* step-down would be chosen and would under-report the bound, making a render louder rather
|
|
79
|
+
* than quieter. No corpus coil is shaped that way -- a tap-to-tap ratio is within a factor of
|
|
80
|
+
* two of one, and a plate-to-speaker ratio is 10x to 40x down.
|
|
81
|
+
*/
|
|
82
|
+
export function portFullScaleVolts(blocks, ports) {
|
|
83
|
+
let supplyVolts = 0;
|
|
84
|
+
/** Smallest transformer factor found at each node. */
|
|
85
|
+
const portFactor = new Map();
|
|
86
|
+
/** Nodes joined to each other by a near-short: a selector throw or a switch. */
|
|
87
|
+
const shorted = new Map();
|
|
88
|
+
const join = (a, b) => {
|
|
89
|
+
if (a === undefined || b === undefined || a === GROUND || b === GROUND) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
for (const [from, to] of [
|
|
93
|
+
[a, b],
|
|
94
|
+
[b, a],
|
|
95
|
+
]) {
|
|
96
|
+
const set = shorted.get(from) ?? new Set();
|
|
97
|
+
set.add(to);
|
|
98
|
+
shorted.set(from, set);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const noteFactor = (node, factor) => {
|
|
102
|
+
if (node === undefined || node === GROUND) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
portFactor.set(node, Math.min(portFactor.get(node) ?? factor, factor));
|
|
106
|
+
};
|
|
107
|
+
for (const block of blocks) {
|
|
108
|
+
if (block.kind !== "mna") {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
for (const stamp of block.stamps) {
|
|
112
|
+
// **Both source kinds, and an amp needs the AC one.** A tube amp's B+ is rectified
|
|
113
|
+
// from a mains winding, so its supply appears as `ac-source` peaks and its
|
|
114
|
+
// `dc-source` maximum is zero: measured, `fender-5e3-deluxe-tweed` states 466.7 V
|
|
115
|
+
// peak of AC and 0 V of DC. Reading only `dc-source` returned `null` for three of
|
|
116
|
+
// the five compiling amps -- the exact silent gap this bound exists to close.
|
|
117
|
+
if (stamp.kind === "dc-source") {
|
|
118
|
+
supplyVolts = Math.max(supplyVolts, Math.abs(stamp.volts));
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (stamp.kind === "ac-source") {
|
|
122
|
+
supplyVolts = Math.max(supplyVolts, Math.abs(stamp.amplitudeVolts));
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
// Row indices, not node ids -- a block's stamps address its matrix rows, which is why
|
|
126
|
+
// the transformer branch below indexes `nodeIds` too. Passing them through raw found
|
|
127
|
+
// no winding for any of the nine amps this traversal exists for.
|
|
128
|
+
if (stamp.kind === "selector") {
|
|
129
|
+
join(block.nodeIds[stamp.common], block.nodeIds[stamp.throwNode]);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (stamp.kind === "switch") {
|
|
133
|
+
join(block.nodeIds[stamp.a], block.nodeIds[stamp.b]);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (stamp.kind !== "transformer") {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (!Number.isFinite(stamp.turnsRatio) || stamp.turnsRatio <= 0) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
// The stamp is `Vp - n*Vs = 0`, so a node on the primary side is `n` times the other
|
|
143
|
+
// side and a node on the secondary side is `1/n` of it. **Which side a speaker sits
|
|
144
|
+
// on is not an assumption to make**: `fender-5e3-deluxe-tweed` lowers with its 8 ohm
|
|
145
|
+
// load on `primary` and its plates on `secondary`, and `fender-5f1-champ` the other
|
|
146
|
+
// way round, so both directions are recorded and the port's own node decides.
|
|
147
|
+
for (const row of [stamp.primaryPlus, stamp.primaryMinus]) {
|
|
148
|
+
noteFactor(block.nodeIds[row], stamp.turnsRatio);
|
|
149
|
+
}
|
|
150
|
+
for (const row of [stamp.secondaryPlus, stamp.secondaryMinus]) {
|
|
151
|
+
noteFactor(block.nodeIds[row], 1 / stamp.turnsRatio);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (supplyVolts <= 0) {
|
|
156
|
+
// No supply stated, so no bound exists for either port. A passive pedal --
|
|
157
|
+
// `ernie-ball-vp-jr` -- lands here honestly.
|
|
158
|
+
return { input: null, output: null };
|
|
159
|
+
}
|
|
160
|
+
const outputNode = ports?.output ??
|
|
161
|
+
(() => {
|
|
162
|
+
for (const block of blocks) {
|
|
163
|
+
if (block.kind === "mna" && block.outputNode !== null) {
|
|
164
|
+
return block.nodeIds[block.outputNode];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return undefined;
|
|
168
|
+
})();
|
|
169
|
+
const factor = outputNode === undefined
|
|
170
|
+
? undefined
|
|
171
|
+
: factorNear(outputNode, portFactor, shorted);
|
|
172
|
+
return {
|
|
173
|
+
// **An input's bound is not derivable from the supply, so nothing is derived here.** The
|
|
174
|
+
// rails bound what a node can *reach*, which is the right bound for an output and the
|
|
175
|
+
// wrong one for an input: an amp's grid circuit sets its input sensitivity, and
|
|
176
|
+
// `fender-5e3`'s 466.7 V rail says nothing about it. Deriving it anyway gave that amp an
|
|
177
|
+
// input bound of 466.7 V, which would attenuate a 9 V pedal by 50x at that seam -- a
|
|
178
|
+
// fabricated number producing an audible error, which is worse than no number at all.
|
|
179
|
+
//
|
|
180
|
+
// The missing fact is an input sensitivity, **or a `V0dBFS` on the input jack -- and this
|
|
181
|
+
// comment used to record that no packet declared one.** Measured 2026-09-03: 98 of the 142
|
|
182
|
+
// corpus documents do, 77 pedals and 21 amps, at 0.1, 0.15, 0.2 and 1 V. `link.ts` reads
|
|
183
|
+
// them and prefers them over anything derived on either port. Null here still means the
|
|
184
|
+
// same thing -- nothing is inferred from rails -- and where no declaration exists the
|
|
185
|
+
// chain scales by 1 and `src/runtime/chain-scale.ts` says so.
|
|
186
|
+
input: null,
|
|
187
|
+
output: factor === undefined ? supplyVolts : supplyVolts * factor,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The transformer factor at `node`, or at the nearest node joined to it by near-shorts.
|
|
192
|
+
*
|
|
193
|
+
* Breadth-first so the nearest winding wins, and the smallest factor among equally near ones --
|
|
194
|
+
* an impedance selector reaches three taps at one hop, any of which the control may close, and
|
|
195
|
+
* the tightest bound is the one that has to hold for all of them.
|
|
196
|
+
*/
|
|
197
|
+
function factorNear(node, portFactor, shorted) {
|
|
198
|
+
const seen = new Set([node]);
|
|
199
|
+
let frontier = [node];
|
|
200
|
+
// Two hops covers a jack behind a selector behind a switch. Unbounded would let a chain of
|
|
201
|
+
// shorts borrow a factor from an unrelated winding across the amp.
|
|
202
|
+
for (let hop = 0; hop < 3 && frontier.length > 0; hop += 1) {
|
|
203
|
+
let best;
|
|
204
|
+
for (const at of frontier) {
|
|
205
|
+
const factor = portFactor.get(at);
|
|
206
|
+
if (factor !== undefined) {
|
|
207
|
+
best = best === undefined ? factor : Math.min(best, factor);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (best !== undefined) {
|
|
211
|
+
return best;
|
|
212
|
+
}
|
|
213
|
+
const next = [];
|
|
214
|
+
for (const at of frontier) {
|
|
215
|
+
for (const neighbour of shorted.get(at) ?? []) {
|
|
216
|
+
if (!seen.has(neighbour)) {
|
|
217
|
+
seen.add(neighbour);
|
|
218
|
+
next.push(neighbour);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
frontier = next;
|
|
223
|
+
}
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
export function deriveFullScaleVolts(supplyVolts, turnsRatio) {
|
|
227
|
+
if (supplyVolts === null || !Number.isFinite(supplyVolts) || supplyVolts <= 0) {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
if (turnsRatio === null || !Number.isFinite(turnsRatio) || turnsRatio <= 0) {
|
|
231
|
+
return supplyVolts;
|
|
232
|
+
}
|
|
233
|
+
return supplyVolts / turnsRatio;
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=port-full-scale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port-full-scale.js","sourceRoot":"","sources":["../src/port-full-scale.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,qFAAqF;AACrF,iGAAiG;AACjG,8FAA8F;AAC9F,SAAS;AACT,EAAE;AACF,gGAAgG;AAChG,gGAAgG;AAChG,iGAAiG;AACjG,4FAA4F;AAC5F,mFAAmF;AACnF,EAAE;AACF,iGAAiG;AACjG,8FAA8F;AAC9F,0DAA0D;AAE1D,OAAO,EAAc,MAAM,EAA2B,MAAM,SAAS,CAAC;AAOtE;;;;;;;;GAQG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,kBAAkB,CACjC,MAAwB,EACxB,KAAa;IAEb,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,sDAAsD;IACtD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC7C,gFAAgF;IAChF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC/C,MAAM,IAAI,GAAG,CAAC,CAAqB,EAAE,CAAqB,EAAQ,EAAE;QACnE,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,MA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C,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;QAC/E,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,UAAU,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,CAAC,EAAE,CAAC;QAC5E,OAAO,WAAW,CAAC;IACpB,CAAC;IACD,OAAO,WAAW,GAAG,UAAU,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Device, Netlist, NodeId } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* How far each node sits, in hops through DC-conducting devices, from a quiet DC reference --
|
|
4
|
+
* ground, or a supply's own terminal.
|
|
5
|
+
*
|
|
6
|
+
* This is the connectivity evidence a pot's orientation needs, in the same closed vocabulary
|
|
7
|
+
* `netlist.ts`'s `voltagePortRails` already uses to ask a related question ("is this node's
|
|
8
|
+
* potential already generated"): `dcConductingKinds` -- resistor, potentiometer, rheostat,
|
|
9
|
+
* inductor, switch, selector -- conduct a steady current, and nothing else in this set does, so
|
|
10
|
+
* an active device (a transistor, an op-amp, a diode) is never crossed. A quiet reference is
|
|
11
|
+
* ground itself or any terminal of a `voltage-source` or `rail` device -- **not** an op-amp
|
|
12
|
+
* output, which is actively driven with the signal and is the opposite of quiet.
|
|
13
|
+
*
|
|
14
|
+
* Computed once per netlist and passed down, not per pot: `boss-ds-1` alone lowers 82 regions,
|
|
15
|
+
* and the graph does not change between them.
|
|
16
|
+
*/
|
|
17
|
+
export declare function quietDistances(netlist: Netlist): ReadonlyMap<NodeId, number>;
|
|
18
|
+
/**
|
|
19
|
+
* How far each node sits, in hops through DC-conducting devices, from an op-amp's own input
|
|
20
|
+
* terminal.
|
|
21
|
+
*
|
|
22
|
+
* A second, narrower quiet-reference class than `quietDistances`, kept separate rather than
|
|
23
|
+
* folded into it. An op-amp input under closed-loop negative feedback sits at a virtual
|
|
24
|
+
* reference regardless of the feedback network's own resistances -- a property of the feedback
|
|
25
|
+
* *topology*, not of any one element's value -- so seeding it is not the same evidence-standing-
|
|
26
|
+
* on-itself risk `netlist.ts`'s `generated()` was found to have (there, an op-amp's *output* was
|
|
27
|
+
* treated as an independent reference, which a feedback path can make circular: the output's own
|
|
28
|
+
* potential depends on the input it would be certifying). Measured 2026-08-14 (the rheostat-nine
|
|
29
|
+
* census, `docs/todo-archive/2026-08-14-the-rheostat-nine.md`): applied unconditionally, this
|
|
30
|
+
* evidence moves 24 pots, 15 of them reversing an orientation `quietDistances` alone already
|
|
31
|
+
* decided -- including undoing a same-day correction and overturning a pot where declaration
|
|
32
|
+
* order and connectivity previously agreed unanimously. `potTerminals` below therefore only
|
|
33
|
+
* consults this map when `quietDistances` leaves a pot's two ends **fully unreachable** (both
|
|
34
|
+
* infinite) -- never to override an already-finite decision, even a finite tie. Scoped that way,
|
|
35
|
+
* it moves exactly 6 pots and reverses none.
|
|
36
|
+
*/
|
|
37
|
+
export declare function opampInputDistances(netlist: Netlist): ReadonlyMap<NodeId, number>;
|
|
38
|
+
/**
|
|
39
|
+
* How far each node sits, in hops through DC-conducting devices, from an op-amp's declared
|
|
40
|
+
* **output** terminal.
|
|
41
|
+
*
|
|
42
|
+
* The companion of `opampInputDistances` for the negative-feedback gain-stage class: a rheostat
|
|
43
|
+
* wired from an op-amp's declared output, through its track, to the same op-amp's declared
|
|
44
|
+
* inverting input is a gain-setting feedback element, and for that class a rising control must
|
|
45
|
+
* mean *more* feedback resistance (non-inverting gain is `1 + Rf/Rg`, so more `Rf` is more
|
|
46
|
+
* gain). `boss-os-2`'s `DRIVE` sits exactly there on both its 270 k sections: the wiper shares
|
|
47
|
+
* its node with the `output` terminal, the free end reaches the `inverting` terminal through a
|
|
48
|
+
* single series resistor, and the whole pocket is DC-isolated from ground, so
|
|
49
|
+
* `quietDistances` has no claim and the `opampInputDistances` tie above falls through to
|
|
50
|
+
* declaration order -- which oriented `VR3b` so its live resistance *fell* as the knob rose,
|
|
51
|
+
* running the pedal's Drive backwards (rendered: 6.3e-1 rms at 0.0 against 2.9e-1 at 1.0).
|
|
52
|
+
* The output-side distance below is the discriminating typed fact: which end the wiper is
|
|
53
|
+
* strapped to relative to the declared `output` role, not how close either end happens to sit
|
|
54
|
+
* to an input.
|
|
55
|
+
*/
|
|
56
|
+
export declare function opampOutputDistances(netlist: Netlist): ReadonlyMap<NodeId, number>;
|
|
57
|
+
/**
|
|
58
|
+
* The set of nodes that are a declared op-amp **inverting** input, read from the declared
|
|
59
|
+
* `inverting` role rather than a folded terminal name (the same closed-vocabulary read
|
|
60
|
+
* `opampInputDistances` uses for its seeds, narrowed to the inverting half).
|
|
61
|
+
*
|
|
62
|
+
* Kept as a node set, not a distance map, because the one consumer below asks a yes/no
|
|
63
|
+
* question -- "does this pot's wiper sit on an inverting input?" -- not "how far is it from
|
|
64
|
+
* one". `opampInputDistances` cannot answer that: it seeds from *both* input roles, so a zero
|
|
65
|
+
* there does not say which input a node sits on.
|
|
66
|
+
*/
|
|
67
|
+
export declare function opampInvertingInputNodes(netlist: Netlist): ReadonlySet<NodeId>;
|
|
68
|
+
/**
|
|
69
|
+
* How far each node sits, in hops through the **AC** graph (DC-conducting devices *plus*
|
|
70
|
+
* capacitors), from an op-amp's declared output terminal.
|
|
71
|
+
*
|
|
72
|
+
* The companion of `opampOutputDistances` for the one shape it cannot reach: a non-inverting
|
|
73
|
+
* gain pot whose wiper sits *on* the op-amp's declared inverting input. For that class the wiper
|
|
74
|
+
* is the DC hub -- both track ends reach ground, the inverting input, and the output through the
|
|
75
|
+
* wiper in exactly the same number of DC hops -- so every DC distance map this file has is a
|
|
76
|
+
* tie and is silent about which end the live half is. Capacitors are the one passive element
|
|
77
|
+
* that separates the two ends in that shape (the output couples to one end, ground to the
|
|
78
|
+
* other), so the discrimination has to follow them. `boss-ds-1`'s `VR1` is the corpus's sole
|
|
79
|
+
* instance: its two ends are a 2/2 DC-quiet tie, the wiper is on the inverting input, and
|
|
80
|
+
* only `AC` separates the output-coupled end (one cap, `C6`, from the output) from the
|
|
81
|
+
* ground-coupled end.
|
|
82
|
+
*
|
|
83
|
+
* Computed over the AC graph on purpose, not by adding a capacitor-aware variant to the DC
|
|
84
|
+
* maps: the DC maps are a validated "moves exactly 6 pots, reverses none" instrument and must
|
|
85
|
+
* stay DC, and folding a capacitor into them would change what every existing caller reads.
|
|
86
|
+
*/
|
|
87
|
+
export declare function opampOutputAcDistances(netlist: Netlist): ReadonlyMap<NodeId, number>;
|
|
88
|
+
export declare function potTerminals(device: Device, quietDistance: ReadonlyMap<NodeId, number>, opampInputDistance: ReadonlyMap<NodeId, number>,
|
|
89
|
+
/**
|
|
90
|
+
* Distance to an op-amp's declared output terminal, for the negative-feedback
|
|
91
|
+
* gain-stage tie below. Empty by default: a call site that has no netlist in hand
|
|
92
|
+
* (the inert-control and operating-point screens) passes nothing and gets today's
|
|
93
|
+
* behaviour exactly, as with the other two maps.
|
|
94
|
+
*/
|
|
95
|
+
opampOutputDistance?: ReadonlyMap<NodeId, number>,
|
|
96
|
+
/**
|
|
97
|
+
* The declared role of the control that varies this pot, when the document states one.
|
|
98
|
+
* Only consulted for the rheostat exemption below; every other path ignores it, and a
|
|
99
|
+
* call site that has no role passes `null` and gets today's behaviour exactly.
|
|
100
|
+
*/
|
|
101
|
+
controlRole?: string | null,
|
|
102
|
+
/**
|
|
103
|
+
* Nodes that are a declared op-amp inverting input, for the negative-feedback gain-pot
|
|
104
|
+
* tie below. Empty by default: a call site with no netlist in hand (the inert-control and
|
|
105
|
+
* operating-point screens) passes nothing and gets today's behaviour exactly, as with the
|
|
106
|
+
* other evidence maps.
|
|
107
|
+
*/
|
|
108
|
+
invertingInputNodes?: ReadonlySet<NodeId>,
|
|
109
|
+
/**
|
|
110
|
+
* AC distance (DC + capacitors) to an op-amp's declared output, for the same gain-pot
|
|
111
|
+
* tie. Empty by default for the same reason.
|
|
112
|
+
*/
|
|
113
|
+
acOutputDistance?: ReadonlyMap<NodeId, number>): readonly [number, number, number];
|
|
114
|
+
//# sourceMappingURL=pot-orientation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pot-orientation.d.ts","sourceRoot":"","sources":["../src/pot-orientation.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAuIvD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAU5E;AAiBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,OAAO,GACd,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,OAAO,GACd,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,OAAO,GACd,WAAW,CAAC,MAAM,CAAC,CAgBrB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,OAAO,GACd,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB7B;AA4CD,wBAAgB,YAAY,CAC3B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1C,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;AAC/C;;;;;GAKG;AACH,mBAAmB,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAa;AAC5D;;;;GAIG;AACH,WAAW,GAAE,MAAM,GAAG,IAAW;AACjC;;;;;GAKG;AACH,mBAAmB,GAAE,WAAW,CAAC,MAAM,CAAa;AACpD;;;GAGG;AACH,gBAAgB,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CA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