@onda-lang/webaudio 0.8.5 → 0.8.6

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 (2) hide show
  1. package/api.md +16 -3
  2. package/package.json +2 -2
package/api.md CHANGED
@@ -135,12 +135,14 @@ endpoints, apply linear, logarithmic, or curved scale, and clamp and snap to the
135
135
 
136
136
  Complete wasm32 processor exports receive an optional execution-output descriptor containing
137
137
  independently nullable delegate and print batches. Allocate all descriptors and storage before
138
- real-time execution.
138
+ real-time execution. Their linear-memory regions must be mutually disjoint and must not overlap any
139
+ other region accessed by the processor call, matching the processor ABI's execution-output
140
+ contract.
139
141
 
140
142
  `writeDelegateBatch` and `writePrintBatch` initialize reusable batch descriptors.
141
143
  `writeExecutionOutput` connects their addresses. Call `resetExecutionOutput` immediately before
142
- every generated init or process entry. Generated event entries reset after successful input
143
- preflight instead, so rejected input preserves existing records. After a successful generated call,
144
+ every generated init or process entry. Generated event entries reset before input preflight, so
145
+ rejected input returns empty batches. After a successful generated call,
144
146
  `readDelegateBatch` or `readPrintBatch` validates the result counters.
145
147
  `decodeDelegateRecords` converts delegate payloads using `metadata.delegates`.
146
148
  `decodePrintRecords` preserves primitive types and source sites; `formatPrintRecords` and
@@ -303,6 +305,7 @@ OndaPayloadSchema
303
305
  OndaPayloadDefault
304
306
  OndaPayloadValue
305
307
  OndaPayloadSizes
308
+ OndaPayloadTensorMetadata
306
309
  PayloadPlan
307
310
  canonicalF32Number
308
311
  EVENT_INPUT_SIZE_BYTES
@@ -432,11 +435,21 @@ are rejected. Missing event arguments use declared constant defaults.
432
435
  Supply `i64` as `bigint`, an exact safe integer, or a decimal string. `decode(bytes)` returns named
433
436
  nested values with `bigint` for `i64`. Plans own immutable schema snapshots.
434
437
 
438
+ `tensorMetadata` exposes the schema's flattened SoA contract without reparsing JSON. Each immutable
439
+ record contains `path`, `encoding`, fixed `shape`, `parameterIndex`, `isSlice`, and
440
+ `fixedElementCount`. Tuple path components use `__0`, `__1`, and so on. A slice's runtime tensor
441
+ length is its logical length times `fixedElementCount`; the dynamic outer axis is therefore not
442
+ repeated in `shape`.
443
+
435
444
  `requiredWorkspace(bytes)` preflights packed little-endian input. `sizes(lengths)` reports wire
436
445
  and aligned workspace sizes without allocating payload storage. Low-level wasm hosts provision
437
446
  both regions and a 16-byte descriptor, then call `writeEventInput` before invoking the event.
438
447
  Rejected input returns `PROCESSOR_EXECUTION_INPUT_REJECTED` (2) and leaves processor state usable.
439
448
  `OndaAudioProcessor.trigger` performs logical encoding before transferring bytes to the worklet.
449
+ Web hosts intentionally have no unchecked tensor-view event entry: JavaScript values must cross the
450
+ main-thread/worklet and Wasm linear-memory boundaries, so native borrowed addresses cannot be
451
+ preserved end to end. Web event dispatch remains the packed, checked `onda_event_N` path and uses
452
+ its preallocated workspace.
440
453
  Decoded `f32` leaves use `canonicalF32Number(value)`: the returned JavaScript number has the
441
454
  shortest decimal representation that round-trips to the same `f32`, so JSON and controls do not
442
455
  expose an irrelevant widened binary tail.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onda-lang/webaudio",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "type": "module",
5
5
  "description": "Optional Web Audio adapter for Onda processor WebAssembly artifacts",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "prepack": "node ../../scripts/stage-web-api-docs.mjs"
35
35
  },
36
36
  "dependencies": {
37
- "@onda-lang/processor-abi": "0.8.5"
37
+ "@onda-lang/processor-abi": "0.8.6"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"