renkin 0.35.0 → 0.37.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 +2 -2
- package/package.json +1 -1
- package/renkin.d.ts +37 -0
- package/renkin.js +100 -0
- package/renkin_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -563,7 +563,7 @@ The JSON output includes `avg_nodes_expanded`, `avg_confidence`, `avg_convergenc
|
|
|
563
563
|
| `plan_with_constraints` | Constraint-DSL planning (element filters, step limits, confidence thresholds) |
|
|
564
564
|
| `estimate_diversity` | Route diversity and coverage metrics |
|
|
565
565
|
|
|
566
|
-
The server auto-detects `data/building_blocks.smi` and `data/templates_extracted_5000.smi` in the working directory. Falls back to the embedded `DEFAULT_BUILDING_BLOCKS` / `default_rules()` defaults if not found (152 unique building blocks per `ChemEnv::bb_count()`,
|
|
566
|
+
The server auto-detects `data/building_blocks.smi` and `data/templates_extracted_5000.smi` in the working directory. Falls back to the embedded `DEFAULT_BUILDING_BLOCKS` / `default_rules()` defaults if not found (152 unique building blocks per `ChemEnv::bb_count()`, 21 handcrafted rules — verified 2026-08-29, after `heck_retro`'s removal (ring-fusion connectivity-collapse defect on internal alkenes fused to the same aromatic ring the leaving-group Br attaches to, confirmed by direct `apply_retro` reproduction on indene) dropped the count from 22, which itself followed `negishi_retro`'s and `grignard_addition_retro`'s removal (v0.36.0 rule-safety census: same ring-fused-atom-duplication defect as `aryl_amine_retro`/`buchwald_hartwig_retro`) dropping it from 24; a "509-BB / 20-rule" figure was previously documented here without verification).
|
|
567
567
|
|
|
568
568
|
```bash
|
|
569
569
|
cargo build --release
|
|
@@ -602,7 +602,7 @@ Target SMILES
|
|
|
602
602
|
┌─────────────────────────┐
|
|
603
603
|
│ chem_env.rs │ ← chematic wrapper
|
|
604
604
|
│ - SMILES parse │ canonical-SMILES FxHashSet BB lookup (O(1))
|
|
605
|
-
│ -
|
|
605
|
+
│ - 22 built-in + up to 50k via --templates │ fragment sanitization + ring-leak filter
|
|
606
606
|
│ - Building block check │ apply_retro memoization cache
|
|
607
607
|
└────────────┬────────────┘
|
|
608
608
|
│ par_iter (rayon / sequential on WASM)
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"kent-tokyo <kent-tokyo@users.noreply.github.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "Ultra-fast retrosynthesis engine for computer-aided synthesis planning (CASP) — pure Rust, WASM-ready, Python bindings via PyO3",
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.37.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
package/renkin.d.ts
CHANGED
|
@@ -103,6 +103,41 @@ export function find_routes_v2(target: string, depth: number, max_routes: number
|
|
|
103
103
|
*/
|
|
104
104
|
export function find_routes_v3(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string): string;
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Same as [`find_routes_v3`], plus `beam_diversity_policy`/
|
|
108
|
+
* `beam_diversity_slots` (`docs/design/diversity-reserved-beam-v0.md`):
|
|
109
|
+
* `"off"` (default) | `"diagnostics_only"` | `"active"`, same vocabulary
|
|
110
|
+
* as the CLI's `--beam-diversity-policy` flag and the Python binding's
|
|
111
|
+
* `beam_diversity_policy` kwarg. `"active"` can change which candidates
|
|
112
|
+
* (and therefore which `routes`) come back, same caveat as
|
|
113
|
+
* `spectator_bond_policy`'s own `"gated"`. A distinct function name
|
|
114
|
+
* rather than extending `find_routes_v3`'s signature, matching that
|
|
115
|
+
* function's own stated reasoning. `beam_diversity_stats` isn't surfaced
|
|
116
|
+
* in this output either, for the same reason `spectator_bond`'s findings
|
|
117
|
+
* aren't -- WASM has no `search_diagnostics`-equivalent block at all
|
|
118
|
+
* today, for any `CrowdOutDiagnostics` field; only the policy control
|
|
119
|
+
* itself (and its effect on `routes`) is in scope here.
|
|
120
|
+
*/
|
|
121
|
+
export function find_routes_v4(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string, beam_diversity_policy: string, beam_diversity_slots: number): string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Same as [`find_routes_v4`], plus `element_accounting_policy`
|
|
125
|
+
* (`docs/design/candidate-time-element-accounting-gate-v0.md`): `"off"`
|
|
126
|
+
* (default) | `"diagnostics_only"` | `"gated"`, same vocabulary as the
|
|
127
|
+
* CLI's `--element-accounting-policy` flag and the Python binding's
|
|
128
|
+
* `element_accounting_policy` kwarg -- an independent axis from
|
|
129
|
+
* `spectator_bond_policy`, never folded together. `"gated"` can change
|
|
130
|
+
* which candidates (and therefore which `routes`) come back, same caveat
|
|
131
|
+
* as `spectator_bond_policy`'s own `"gated"`. A distinct function name
|
|
132
|
+
* rather than extending `find_routes_v4`'s signature, matching that
|
|
133
|
+
* function's own stated reasoning. `element_accounting_gated_out` isn't
|
|
134
|
+
* surfaced in this output either, for the same reason `spectator_bond`'s
|
|
135
|
+
* findings aren't -- WASM has no `search_diagnostics`-equivalent block at
|
|
136
|
+
* all today, for any `CrowdOutDiagnostics` field; only the policy control
|
|
137
|
+
* itself (and its effect on `routes`) is in scope here.
|
|
138
|
+
*/
|
|
139
|
+
export function find_routes_v5(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string, element_accounting_policy: string, beam_diversity_policy: string, beam_diversity_slots: number): string;
|
|
140
|
+
|
|
106
141
|
/**
|
|
107
142
|
* Return the crate version string.
|
|
108
143
|
*/
|
|
@@ -118,6 +153,8 @@ export interface InitOutput {
|
|
|
118
153
|
readonly find_routes: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
119
154
|
readonly find_routes_v2: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number];
|
|
120
155
|
readonly find_routes_v3: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
|
|
156
|
+
readonly find_routes_v4: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => [number, number];
|
|
157
|
+
readonly find_routes_v5: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => [number, number];
|
|
121
158
|
readonly version: () => [number, number];
|
|
122
159
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
123
160
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
package/renkin.js
CHANGED
|
@@ -228,6 +228,106 @@ export function find_routes_v3(target, depth, max_routes, beam_width, avoid_elem
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Same as [`find_routes_v3`], plus `beam_diversity_policy`/
|
|
233
|
+
* `beam_diversity_slots` (`docs/design/diversity-reserved-beam-v0.md`):
|
|
234
|
+
* `"off"` (default) | `"diagnostics_only"` | `"active"`, same vocabulary
|
|
235
|
+
* as the CLI's `--beam-diversity-policy` flag and the Python binding's
|
|
236
|
+
* `beam_diversity_policy` kwarg. `"active"` can change which candidates
|
|
237
|
+
* (and therefore which `routes`) come back, same caveat as
|
|
238
|
+
* `spectator_bond_policy`'s own `"gated"`. A distinct function name
|
|
239
|
+
* rather than extending `find_routes_v3`'s signature, matching that
|
|
240
|
+
* function's own stated reasoning. `beam_diversity_stats` isn't surfaced
|
|
241
|
+
* in this output either, for the same reason `spectator_bond`'s findings
|
|
242
|
+
* aren't -- WASM has no `search_diagnostics`-equivalent block at all
|
|
243
|
+
* today, for any `CrowdOutDiagnostics` field; only the policy control
|
|
244
|
+
* itself (and its effect on `routes`) is in scope here.
|
|
245
|
+
* @param {string} target
|
|
246
|
+
* @param {number} depth
|
|
247
|
+
* @param {number} max_routes
|
|
248
|
+
* @param {number} beam_width
|
|
249
|
+
* @param {string} avoid_elements
|
|
250
|
+
* @param {string} require_elements
|
|
251
|
+
* @param {string} spectator_bond_policy
|
|
252
|
+
* @param {string} beam_diversity_policy
|
|
253
|
+
* @param {number} beam_diversity_slots
|
|
254
|
+
* @returns {string}
|
|
255
|
+
*/
|
|
256
|
+
export function find_routes_v4(target, depth, max_routes, beam_width, avoid_elements, require_elements, spectator_bond_policy, beam_diversity_policy, beam_diversity_slots) {
|
|
257
|
+
let deferred6_0;
|
|
258
|
+
let deferred6_1;
|
|
259
|
+
try {
|
|
260
|
+
const ptr0 = passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
261
|
+
const len0 = WASM_VECTOR_LEN;
|
|
262
|
+
const ptr1 = passStringToWasm0(avoid_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
263
|
+
const len1 = WASM_VECTOR_LEN;
|
|
264
|
+
const ptr2 = passStringToWasm0(require_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
+
const len2 = WASM_VECTOR_LEN;
|
|
266
|
+
const ptr3 = passStringToWasm0(spectator_bond_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
267
|
+
const len3 = WASM_VECTOR_LEN;
|
|
268
|
+
const ptr4 = passStringToWasm0(beam_diversity_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
269
|
+
const len4 = WASM_VECTOR_LEN;
|
|
270
|
+
const ret = wasm.find_routes_v4(ptr0, len0, depth, max_routes, beam_width, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, beam_diversity_slots);
|
|
271
|
+
deferred6_0 = ret[0];
|
|
272
|
+
deferred6_1 = ret[1];
|
|
273
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
274
|
+
} finally {
|
|
275
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Same as [`find_routes_v4`], plus `element_accounting_policy`
|
|
281
|
+
* (`docs/design/candidate-time-element-accounting-gate-v0.md`): `"off"`
|
|
282
|
+
* (default) | `"diagnostics_only"` | `"gated"`, same vocabulary as the
|
|
283
|
+
* CLI's `--element-accounting-policy` flag and the Python binding's
|
|
284
|
+
* `element_accounting_policy` kwarg -- an independent axis from
|
|
285
|
+
* `spectator_bond_policy`, never folded together. `"gated"` can change
|
|
286
|
+
* which candidates (and therefore which `routes`) come back, same caveat
|
|
287
|
+
* as `spectator_bond_policy`'s own `"gated"`. A distinct function name
|
|
288
|
+
* rather than extending `find_routes_v4`'s signature, matching that
|
|
289
|
+
* function's own stated reasoning. `element_accounting_gated_out` isn't
|
|
290
|
+
* surfaced in this output either, for the same reason `spectator_bond`'s
|
|
291
|
+
* findings aren't -- WASM has no `search_diagnostics`-equivalent block at
|
|
292
|
+
* all today, for any `CrowdOutDiagnostics` field; only the policy control
|
|
293
|
+
* itself (and its effect on `routes`) is in scope here.
|
|
294
|
+
* @param {string} target
|
|
295
|
+
* @param {number} depth
|
|
296
|
+
* @param {number} max_routes
|
|
297
|
+
* @param {number} beam_width
|
|
298
|
+
* @param {string} avoid_elements
|
|
299
|
+
* @param {string} require_elements
|
|
300
|
+
* @param {string} spectator_bond_policy
|
|
301
|
+
* @param {string} element_accounting_policy
|
|
302
|
+
* @param {string} beam_diversity_policy
|
|
303
|
+
* @param {number} beam_diversity_slots
|
|
304
|
+
* @returns {string}
|
|
305
|
+
*/
|
|
306
|
+
export function find_routes_v5(target, depth, max_routes, beam_width, avoid_elements, require_elements, spectator_bond_policy, element_accounting_policy, beam_diversity_policy, beam_diversity_slots) {
|
|
307
|
+
let deferred7_0;
|
|
308
|
+
let deferred7_1;
|
|
309
|
+
try {
|
|
310
|
+
const ptr0 = passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
311
|
+
const len0 = WASM_VECTOR_LEN;
|
|
312
|
+
const ptr1 = passStringToWasm0(avoid_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
313
|
+
const len1 = WASM_VECTOR_LEN;
|
|
314
|
+
const ptr2 = passStringToWasm0(require_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
315
|
+
const len2 = WASM_VECTOR_LEN;
|
|
316
|
+
const ptr3 = passStringToWasm0(spectator_bond_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
317
|
+
const len3 = WASM_VECTOR_LEN;
|
|
318
|
+
const ptr4 = passStringToWasm0(element_accounting_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
319
|
+
const len4 = WASM_VECTOR_LEN;
|
|
320
|
+
const ptr5 = passStringToWasm0(beam_diversity_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
321
|
+
const len5 = WASM_VECTOR_LEN;
|
|
322
|
+
const ret = wasm.find_routes_v5(ptr0, len0, depth, max_routes, beam_width, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, beam_diversity_slots);
|
|
323
|
+
deferred7_0 = ret[0];
|
|
324
|
+
deferred7_1 = ret[1];
|
|
325
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
326
|
+
} finally {
|
|
327
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
231
331
|
/**
|
|
232
332
|
* Return the crate version string.
|
|
233
333
|
* @returns {string}
|
package/renkin_bg.wasm
CHANGED
|
Binary file
|