@greenpandastudios/aug-cli 0.20.1 → 0.21.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 +1 -1
- package/docs/assets/benchmarks/execution.svg +774 -637
- package/docs/assets/benchmarks/http.svg +278 -249
- package/docs/assets/benchmarks/improvements.svg +66 -66
- package/docs/assets/benchmarks/kernels-mobile.svg +1 -0
- package/docs/assets/benchmarks/kernels.svg +1 -0
- package/docs/assets/benchmarks/memory.svg +153 -153
- package/docs/benchmark-results.json +227089 -90363
- package/docs/compatibility.md +6 -6
- package/docs/contributing-benchmarks.md +36 -6
- package/docs/dev-containers.md +8 -15
- package/docs/dgx-consumers.json +122 -0
- package/docs/dgx-gyms.json +784 -0
- package/docs/dgx-kernels.json +1170 -0
- package/docs/dgx-performance.json +227849 -0
- package/docs/dgx-spark.md +64 -0
- package/docs/diagnostics.md +1 -1
- package/docs/docker.md +16 -17
- package/docs/example-projects.json +32 -0
- package/docs/examples/approved-design/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/approved-design/domain/app.md +4 -4
- package/docs/examples/approved-design/main.md +2 -2
- package/docs/examples/calls-benchmark/index.md +36 -0
- package/docs/examples/calls-benchmark/main.md +78 -0
- package/docs/examples/calls-benchmark/operations.md +60 -0
- package/docs/examples/developer-workflow/calculator.md +5 -5
- package/docs/examples/developer-workflow/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/developer-workflow/logging/console.md +2 -2
- package/docs/examples/developer-workflow/logging/logger.md +2 -2
- package/docs/examples/developer-workflow/main.md +2 -2
- package/docs/examples/errors-benchmark/index.md +36 -0
- package/docs/examples/errors-benchmark/main.md +92 -0
- package/docs/examples/errors-benchmark/operations.md +65 -0
- package/docs/examples/float-benchmark/index.md +35 -0
- package/docs/examples/float-benchmark/main.md +75 -0
- package/docs/examples/generic-di/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/generic-di/main.md +2 -2
- package/docs/examples/generic-di/types.md +3 -3
- package/docs/examples/hello/app/greeter.md +3 -3
- package/docs/examples/hello/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/hello/logging/console.md +2 -2
- package/docs/examples/hello/logging/logger.md +2 -2
- package/docs/examples/hello/main.md +2 -2
- package/docs/examples/index.md +18 -1
- package/docs/examples/interceptors/app.md +5 -5
- package/docs/examples/interceptors/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/interceptors/interceptors.md +2 -2
- package/docs/examples/interceptors/logging.md +3 -3
- package/docs/examples/interceptors/main.md +2 -2
- package/docs/examples/list-benchmark/index.md +35 -0
- package/docs/examples/list-benchmark/main.md +78 -0
- package/docs/examples/map-churn-benchmark/index.md +35 -0
- package/docs/examples/map-churn-benchmark/main.md +106 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/api.md +104 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.md +54 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi-json.md +48 -0
- package/docs/examples/native-blake3/hashing.md +93 -0
- package/docs/examples/native-blake3/index.md +38 -0
- package/docs/examples/native-blake3/main.md +73 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/api.md +406 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.md +51 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.md +63 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi-json.md +161 -0
- package/docs/examples/native-pytorch/index.md +38 -0
- package/docs/examples/native-pytorch/main.md +73 -0
- package/docs/examples/native-pytorch/tensors.md +123 -0
- package/docs/examples/native-sqlite/database.md +116 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/api.md +284 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.md +51 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.md +75 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi-json.md +119 -0
- package/docs/examples/native-sqlite/index.md +38 -0
- package/docs/examples/native-sqlite/main.md +73 -0
- package/docs/examples/native-zlib/compression.md +99 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/api.md +153 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.md +54 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi-json.md +76 -0
- package/docs/examples/native-zlib/index.md +38 -0
- package/docs/examples/native-zlib/main.md +78 -0
- package/docs/examples/new-syntax/console.md +2 -2
- package/docs/examples/new-syntax/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/new-syntax/greeter.md +3 -3
- package/docs/examples/new-syntax/logger.md +2 -2
- package/docs/examples/new-syntax/main.md +2 -2
- package/docs/examples/ownership-transfer/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/ownership-transfer/main.md +2 -2
- package/docs/examples/ownership-transfer/resource.md +2 -2
- package/docs/examples/packages-math/aug-package-json.md +1 -1
- package/docs/examples/records-benchmark/data.md +55 -0
- package/docs/examples/records-benchmark/index.md +36 -0
- package/docs/examples/records-benchmark/main.md +85 -0
- package/docs/examples/strings-benchmark/index.md +35 -0
- package/docs/examples/strings-benchmark/main.md +76 -0
- package/docs/examples/tasks-benchmark/index.md +36 -0
- package/docs/examples/tasks-benchmark/main.md +89 -0
- package/docs/examples/tasks-benchmark/operations.md +58 -0
- package/docs/getting-started.md +3 -3
- package/docs/grammar.md +2 -2
- package/docs/gym-results.json +784 -0
- package/docs/implementation-map.md +6 -0
- package/docs/index.md +1 -1
- package/docs/kernel-results.json +1170 -0
- package/docs/language-conformance.md +6 -0
- package/docs/language-constructs.md +9 -1
- package/docs/learn/index.md +1 -1
- package/docs/maintaining-docs.md +1 -1
- package/docs/native-implementation.md +276 -0
- package/docs/native-interop-llvm-plan.md +342 -0
- package/docs/native-package-examples.md +684 -0
- package/docs/native-packages.md +179 -0
- package/docs/packages.md +2 -2
- package/docs/performance.md +50 -29
- package/docs/production-readiness.md +11 -1
- package/docs/public/downloads/approved-design.zip +0 -0
- package/docs/public/downloads/calls-benchmark.zip +0 -0
- package/docs/public/downloads/developer-workflow.zip +0 -0
- package/docs/public/downloads/errors-benchmark.zip +0 -0
- package/docs/public/downloads/float-benchmark.zip +0 -0
- package/docs/public/downloads/generic-di.zip +0 -0
- package/docs/public/downloads/hello.zip +0 -0
- package/docs/public/downloads/interceptors.zip +0 -0
- package/docs/public/downloads/json-benchmark.zip +0 -0
- package/docs/public/downloads/list-benchmark.zip +0 -0
- package/docs/public/downloads/map-churn-benchmark.zip +0 -0
- package/docs/public/downloads/native-blake3.zip +0 -0
- package/docs/public/downloads/native-pytorch.zip +0 -0
- package/docs/public/downloads/native-sqlite.zip +0 -0
- package/docs/public/downloads/native-zlib.zip +0 -0
- package/docs/public/downloads/new-syntax.zip +0 -0
- package/docs/public/downloads/oidc-login.zip +0 -0
- package/docs/public/downloads/ownership-transfer.zip +0 -0
- package/docs/public/downloads/packages-app.zip +0 -0
- package/docs/public/downloads/packages-math.zip +0 -0
- package/docs/public/downloads/records-benchmark.zip +0 -0
- package/docs/public/downloads/strings-benchmark.zip +0 -0
- package/docs/public/downloads/tasks-benchmark.zip +0 -0
- package/docs/qualification-results.md +66 -0
- package/docs/reference.md +24 -0
- package/docs/releasing.md +81 -6
- package/docs/research/libtorch-native-qualification.md +115 -0
- package/docs/research/native-interop-llvm.md +197 -0
- package/docs/research/qualification-methods.md +15 -0
- package/docs/roadmap.md +1 -0
- package/docs/safety-gyms.md +41 -0
- package/docs/tooling.md +16 -15
- package/docs/web-library-gaps.md +1 -1
- package/docs/web.md +4 -0
- package/examples/approved-design/.aug-spec/manifest.json +3 -3
- package/examples/approved-design/domain/app.aug.md +4 -4
- package/examples/approved-design/main.aug.md +2 -2
- package/examples/developer-workflow/.aug-spec/manifest.json +3 -3
- package/examples/developer-workflow/calculator.aug.md +5 -5
- package/examples/developer-workflow/logging/console.aug.md +2 -2
- package/examples/developer-workflow/logging/logger.aug.md +2 -2
- package/examples/developer-workflow/main.aug.md +2 -2
- package/examples/generic-di/.aug-spec/manifest.json +3 -3
- package/examples/generic-di/main.aug.md +2 -2
- package/examples/generic-di/types.aug.md +3 -3
- package/examples/hello/.aug-spec/manifest.json +3 -3
- package/examples/hello/app/greeter.aug.md +3 -3
- package/examples/hello/logging/console.aug.md +2 -2
- package/examples/hello/logging/logger.aug.md +2 -2
- package/examples/hello/main.aug.md +2 -2
- package/examples/interceptors/.aug-spec/manifest.json +3 -3
- package/examples/interceptors/app.aug.md +5 -5
- package/examples/interceptors/interceptors.aug.md +2 -2
- package/examples/interceptors/logging.aug.md +3 -3
- package/examples/interceptors/main.aug.md +2 -2
- package/examples/native-blake3/.aug-spec/manifest.json +16 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.1/native.abi.json +29 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug +14 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug.md +34 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug +4 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug.md +8 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi.json +29 -0
- package/examples/native-blake3/AGENTS.md +5 -0
- package/examples/native-blake3/aug.lock.json +253 -0
- package/examples/native-blake3/hashing.aug +11 -0
- package/examples/native-blake3/hashing.aug.md +25 -0
- package/examples/native-blake3/main.aug +8 -0
- package/examples/native-blake3/main.aug.md +13 -0
- package/examples/native-pytorch/.aug-spec/manifest.json +18 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.1/native.abi.json +142 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.3/native.abi.json +142 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug +101 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug.md +160 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug +3 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md +8 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug +6 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md +13 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi.json +142 -0
- package/examples/native-pytorch/AGENTS.md +5 -0
- package/examples/native-pytorch/aug.lock.json +309 -0
- package/examples/native-pytorch/main.aug +8 -0
- package/examples/native-pytorch/main.aug.md +13 -0
- package/examples/native-pytorch/tensors.aug +23 -0
- package/examples/native-pytorch/tensors.aug.md +35 -0
- package/examples/native-sqlite/.aug-spec/manifest.json +18 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.2/native.abi.json +100 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug +48 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug.md +91 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug +3 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug.md +8 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug +8 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug.md +22 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi.json +100 -0
- package/examples/native-sqlite/AGENTS.md +5 -0
- package/examples/native-sqlite/aug.lock.json +236 -0
- package/examples/native-sqlite/database.aug +15 -0
- package/examples/native-sqlite/database.aug.md +27 -0
- package/examples/native-sqlite/main.aug +8 -0
- package/examples/native-sqlite/main.aug.md +13 -0
- package/examples/native-zlib/.aug-spec/manifest.json +16 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.1/native.abi.json +57 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug +29 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug.md +54 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug +4 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug.md +8 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi.json +57 -0
- package/examples/native-zlib/AGENTS.md +5 -0
- package/examples/native-zlib/aug.lock.json +236 -0
- package/examples/native-zlib/compression.aug +15 -0
- package/examples/native-zlib/compression.aug.md +27 -0
- package/examples/native-zlib/main.aug +10 -0
- package/examples/native-zlib/main.aug.md +13 -0
- package/examples/new-syntax/.aug-spec/manifest.json +3 -3
- package/examples/new-syntax/console.aug.md +2 -2
- package/examples/new-syntax/greeter.aug.md +3 -3
- package/examples/new-syntax/logger.aug.md +2 -2
- package/examples/new-syntax/main.aug.md +2 -2
- package/examples/oidc-login/aug.lock.json +6 -6
- package/examples/ownership-transfer/.aug-spec/manifest.json +3 -3
- package/examples/ownership-transfer/main.aug.md +2 -2
- package/examples/ownership-transfer/resource.aug.md +2 -2
- package/examples/packages/math/aug-package.json +1 -1
- package/native/compiler-packs.json +43 -0
- package/package.json +3 -2
- package/runtime/aug_http.c +48 -21
- package/runtime/aug_http_ir.c +30 -0
- package/runtime/aug_http_ir.h +18 -0
- package/runtime/aug_ir.c +209 -0
- package/runtime/aug_ir.h +89 -0
- package/runtime/aug_json.c +6 -1
- package/runtime/aug_runtime.c +82 -16
- package/runtime/aug_runtime.h +16 -2
- package/runtime/aug_tasks.c +38 -7
- package/runtime/aug_values.c +12 -6
- package/scripts/bootstrap-native.mjs +4 -1
- package/src/ast.js +1 -1
- package/src/checker.js +110 -28
- package/src/cli.js +92 -14
- package/src/codegen.js +31 -6
- package/src/compiler-packs.js +66 -0
- package/src/config.js +2 -2
- package/src/editor.js +15 -6
- package/src/formatter.js +4 -2
- package/src/git-http.js +137 -0
- package/src/git-packages.js +9 -1
- package/src/help.js +10 -2
- package/src/ir-types.js +5 -0
- package/src/ir-verify.js +277 -0
- package/src/ir.js +962 -0
- package/src/llvm-debug.js +101 -0
- package/src/llvm-native.js +152 -0
- package/src/llvm-platform.js +20 -0
- package/src/llvm.js +781 -0
- package/src/native-artifacts.js +207 -0
- package/src/native-bindings.js +189 -0
- package/src/native-contracts.js +295 -0
- package/src/native-declarations.js +68 -0
- package/src/native-facts.js +63 -0
- package/src/package-locking.js +43 -0
- package/src/package-manager.js +23 -8
- package/src/parser.js +20 -2
- package/src/project.js +2 -2
- package/src/runtime-abi.js +23 -0
- package/src/runtime-adapters.js +18 -0
- package/src/schemas.js +24 -17
- package/src/semantic.js +8 -3
- package/src/snippets.js +1 -0
- package/src/spec.js +49 -8
- /package/examples/approved-design/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/approved-design/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/developer-workflow/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/developer-workflow/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/generic-di/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/generic-di/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/hello/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/hello/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/interceptors/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/interceptors/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/new-syntax/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/new-syntax/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/ownership-transfer/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/ownership-transfer/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": 1,
|
|
3
|
+
"profile": "aug-native-abi-1",
|
|
4
|
+
"resources": [
|
|
5
|
+
{
|
|
6
|
+
"module": "bindings",
|
|
7
|
+
"name": "Tensor",
|
|
8
|
+
"release": "aug_torch_tensor_release_v1"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"functions": [
|
|
12
|
+
{
|
|
13
|
+
"module": "api",
|
|
14
|
+
"name": "_tensor",
|
|
15
|
+
"symbol": "aug_torch_tensor_from_f64_v1",
|
|
16
|
+
"params": [
|
|
17
|
+
{
|
|
18
|
+
"name": "values",
|
|
19
|
+
"kind": "f64-list"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"result": {
|
|
23
|
+
"kind": "resource",
|
|
24
|
+
"resource": "bindings.Tensor"
|
|
25
|
+
},
|
|
26
|
+
"error": "contracts.TensorError",
|
|
27
|
+
"callingConvention": "C",
|
|
28
|
+
"status": "i32",
|
|
29
|
+
"uses": [],
|
|
30
|
+
"changes": [],
|
|
31
|
+
"thread": "caller",
|
|
32
|
+
"retainsInputs": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"module": "api",
|
|
36
|
+
"name": "_add",
|
|
37
|
+
"symbol": "aug_torch_tensor_add_v1",
|
|
38
|
+
"params": [
|
|
39
|
+
{
|
|
40
|
+
"name": "left",
|
|
41
|
+
"kind": "resource",
|
|
42
|
+
"resource": "bindings.Tensor",
|
|
43
|
+
"ownership": "read"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "right",
|
|
47
|
+
"kind": "resource",
|
|
48
|
+
"resource": "bindings.Tensor",
|
|
49
|
+
"ownership": "read"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"result": {
|
|
53
|
+
"kind": "resource",
|
|
54
|
+
"resource": "bindings.Tensor"
|
|
55
|
+
},
|
|
56
|
+
"error": "contracts.TensorError",
|
|
57
|
+
"callingConvention": "C",
|
|
58
|
+
"status": "i32",
|
|
59
|
+
"uses": [],
|
|
60
|
+
"changes": [],
|
|
61
|
+
"thread": "caller",
|
|
62
|
+
"retainsInputs": false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"module": "api",
|
|
66
|
+
"name": "_sum",
|
|
67
|
+
"symbol": "aug_torch_tensor_sum_v1",
|
|
68
|
+
"params": [
|
|
69
|
+
{
|
|
70
|
+
"name": "tensor",
|
|
71
|
+
"kind": "resource",
|
|
72
|
+
"resource": "bindings.Tensor",
|
|
73
|
+
"ownership": "read"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"result": {
|
|
77
|
+
"kind": "f64"
|
|
78
|
+
},
|
|
79
|
+
"error": "contracts.TensorError",
|
|
80
|
+
"callingConvention": "C",
|
|
81
|
+
"status": "i32",
|
|
82
|
+
"uses": [],
|
|
83
|
+
"changes": [],
|
|
84
|
+
"thread": "caller",
|
|
85
|
+
"retainsInputs": false
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"module": "api",
|
|
89
|
+
"name": "_values",
|
|
90
|
+
"symbol": "aug_torch_tensor_values_v1",
|
|
91
|
+
"params": [
|
|
92
|
+
{
|
|
93
|
+
"name": "tensor",
|
|
94
|
+
"kind": "resource",
|
|
95
|
+
"resource": "bindings.Tensor",
|
|
96
|
+
"ownership": "read"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"result": {
|
|
100
|
+
"kind": "f64-list",
|
|
101
|
+
"release": "aug_torch_values_release_v1"
|
|
102
|
+
},
|
|
103
|
+
"error": "contracts.TensorError",
|
|
104
|
+
"callingConvention": "C",
|
|
105
|
+
"status": "i32",
|
|
106
|
+
"uses": [],
|
|
107
|
+
"changes": [],
|
|
108
|
+
"thread": "caller",
|
|
109
|
+
"retainsInputs": false
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"module": "api",
|
|
113
|
+
"name": "_liveTensors",
|
|
114
|
+
"symbol": "aug_probe_live_tensors_v1",
|
|
115
|
+
"params": [],
|
|
116
|
+
"result": {
|
|
117
|
+
"kind": "i64"
|
|
118
|
+
},
|
|
119
|
+
"callingConvention": "C",
|
|
120
|
+
"status": "direct",
|
|
121
|
+
"uses": [],
|
|
122
|
+
"changes": [],
|
|
123
|
+
"thread": "caller",
|
|
124
|
+
"retainsInputs": false
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"module": "api",
|
|
128
|
+
"name": "_liveBuffers",
|
|
129
|
+
"symbol": "aug_probe_live_buffers_v1",
|
|
130
|
+
"params": [],
|
|
131
|
+
"result": {
|
|
132
|
+
"kind": "i64"
|
|
133
|
+
},
|
|
134
|
+
"callingConvention": "C",
|
|
135
|
+
"status": "direct",
|
|
136
|
+
"uses": [],
|
|
137
|
+
"changes": [],
|
|
138
|
+
"thread": "caller",
|
|
139
|
+
"retainsInputs": false
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Generated by aug spec. This is a copy of the installed dependency source.
|
|
2
|
+
// aug-spec: "api.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
3
|
+
import Tensor from bindings
|
|
4
|
+
import TensorError from contracts
|
|
5
|
+
extern C _tensor(List<float> values) returns own Tensor unless TensorError
|
|
6
|
+
extern C _add(Tensor left, Tensor right) returns own Tensor unless TensorError
|
|
7
|
+
extern C _sum(Tensor tensor) returns float unless TensorError
|
|
8
|
+
extern C _values(Tensor tensor) returns List<float> unless TensorError
|
|
9
|
+
/** Copy a list of float64 values into a CPU tensor. */
|
|
10
|
+
tensor(List<float> values) returns own Tensor:
|
|
11
|
+
unsafe:
|
|
12
|
+
return _tensor(values)
|
|
13
|
+
/** Add tensors without changing either input. */
|
|
14
|
+
add(Tensor left, Tensor right) returns own Tensor:
|
|
15
|
+
unsafe:
|
|
16
|
+
return _add(left, right)
|
|
17
|
+
/** Sum every element. */
|
|
18
|
+
sum(Tensor tensor) returns float:
|
|
19
|
+
unsafe:
|
|
20
|
+
return _sum(tensor)
|
|
21
|
+
/** Copy tensor values into an August list. */
|
|
22
|
+
values(Tensor tensor) returns List<float>:
|
|
23
|
+
unsafe:
|
|
24
|
+
return _values(tensor)
|
|
25
|
+
|
|
26
|
+
extern C _liveTensors() returns int
|
|
27
|
+
extern C _liveBuffers() returns int
|
|
28
|
+
|
|
29
|
+
_consumeAndFail(own Tensor value) unless TensorError:
|
|
30
|
+
throw TensorError(code=99, message="expected cleanup test")
|
|
31
|
+
|
|
32
|
+
interface _TensorContainer:
|
|
33
|
+
total() returns float unless TensorError
|
|
34
|
+
_TensorHolder(mutable own Tensor item) implements _TensorContainer:
|
|
35
|
+
total() returns float:
|
|
36
|
+
return sum(tensor=item)
|
|
37
|
+
_replace(borrow _TensorHolder holder, own Tensor replacement):
|
|
38
|
+
holder.item = replacement
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
test tensor:
|
|
42
|
+
when cpu:
|
|
43
|
+
it adds_real_tensors:
|
|
44
|
+
own Tensor left = tensor(values=[1.0, 2.0, 3.0])
|
|
45
|
+
own Tensor right = tensor(values=[4.0, 5.0, 6.0])
|
|
46
|
+
own Tensor result = add(left, right)
|
|
47
|
+
assert(sum(tensor=result) == 21.0)
|
|
48
|
+
List<float> output = values(tensor=result)
|
|
49
|
+
assert(output.length() == 3)
|
|
50
|
+
|
|
51
|
+
when ownership:
|
|
52
|
+
it transfers_into_a_field_and_releases_the_old_tensor:
|
|
53
|
+
int before = 0
|
|
54
|
+
unsafe:
|
|
55
|
+
before = _liveTensors()
|
|
56
|
+
scope:
|
|
57
|
+
own Tensor initial = tensor(values=[1.0])
|
|
58
|
+
own _TensorHolder holder = _TensorHolder(item=initial)
|
|
59
|
+
own Tensor replacement = tensor(values=[7.0])
|
|
60
|
+
borrow holder:
|
|
61
|
+
_replace(holder, replacement)
|
|
62
|
+
assert(holder.total() == 7.0)
|
|
63
|
+
unsafe:
|
|
64
|
+
assert(_liveTensors() == before + 1)
|
|
65
|
+
unsafe:
|
|
66
|
+
assert(_liveTensors() == before)
|
|
67
|
+
it preserves_native_error_methods:
|
|
68
|
+
bool caught = false
|
|
69
|
+
own Tensor left = tensor(values=[1.0, 2.0])
|
|
70
|
+
own Tensor right = tensor(values=[1.0, 2.0, 3.0])
|
|
71
|
+
try:
|
|
72
|
+
add(left, right)
|
|
73
|
+
catch TensorError error:
|
|
74
|
+
caught = error.explain().length() > 0
|
|
75
|
+
assert(caught)
|
|
76
|
+
it releases_a_transferred_tensor_when_the_callee_fails:
|
|
77
|
+
int before = 0
|
|
78
|
+
unsafe:
|
|
79
|
+
before = _liveTensors()
|
|
80
|
+
bool caught = false
|
|
81
|
+
try:
|
|
82
|
+
own Tensor value = tensor(values=[1.0])
|
|
83
|
+
_consumeAndFail(value)
|
|
84
|
+
catch TensorError error:
|
|
85
|
+
caught = error.code == 99
|
|
86
|
+
assert(caught)
|
|
87
|
+
unsafe:
|
|
88
|
+
assert(_liveTensors() == before)
|
|
89
|
+
assert(_liveBuffers() == 0)
|
|
90
|
+
it releases_scoped_and_unused_results:
|
|
91
|
+
int before = 0
|
|
92
|
+
unsafe:
|
|
93
|
+
before = _liveTensors()
|
|
94
|
+
scope:
|
|
95
|
+
own Tensor value = tensor(values=[2.0])
|
|
96
|
+
List<float> output = values(tensor=value)
|
|
97
|
+
assert(output.get(index=0) == 2.0)
|
|
98
|
+
tensor(values=[3.0])
|
|
99
|
+
unsafe:
|
|
100
|
+
assert(_liveTensors() == before)
|
|
101
|
+
assert(_liveBuffers() == 0)
|
package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<!-- Generated by aug spec. Edit the August source, then regenerate. -->
|
|
2
|
+
|
|
3
|
+
# `api.aug`
|
|
4
|
+
|
|
5
|
+
<a id="symbol-tensor"></a>
|
|
6
|
+
## `tensor` · [source](api.aug#L10)
|
|
7
|
+
|
|
8
|
+
Copy a list of float64 values into a CPU tensor. It takes `values` as `List<float>`. It returns ownership of [`Tensor`](bindings.aug.md#symbol-Tensor). Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
9
|
+
|
|
10
|
+
Within an unsafe block, it returns [`_tensor`](api.aug.md#symbol-_tensor) with `values`. Native operations must satisfy their declared C contracts.
|
|
11
|
+
|
|
12
|
+
<a id="symbol-add"></a>
|
|
13
|
+
## `add` · [source](api.aug#L14)
|
|
14
|
+
|
|
15
|
+
Add tensors without changing either input. It takes `left` and `right` as [`Tensor`](bindings.aug.md#symbol-Tensor). It returns ownership of [`Tensor`](bindings.aug.md#symbol-Tensor). Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
16
|
+
|
|
17
|
+
Within an unsafe block, it returns [`_add`](api.aug.md#symbol-_add) with `left` and `right`. Native operations must satisfy their declared C contracts.
|
|
18
|
+
|
|
19
|
+
<a id="symbol-sum"></a>
|
|
20
|
+
## `sum` · [source](api.aug#L18)
|
|
21
|
+
|
|
22
|
+
Sum every element. It takes `tensor` as [`Tensor`](bindings.aug.md#symbol-Tensor). Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
23
|
+
|
|
24
|
+
Within an unsafe block, it returns [`_sum`](api.aug.md#symbol-_sum) with `tensor`. Native operations must satisfy their declared C contracts.
|
|
25
|
+
|
|
26
|
+
<a id="symbol-values"></a>
|
|
27
|
+
## `values` · [source](api.aug#L22)
|
|
28
|
+
|
|
29
|
+
Copy tensor values into an August list. It takes `tensor` as [`Tensor`](bindings.aug.md#symbol-Tensor). Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
30
|
+
|
|
31
|
+
Within an unsafe block, it returns [`_values`](api.aug.md#symbol-_values) with `tensor`. Native operations must satisfy their declared C contracts.
|
|
32
|
+
|
|
33
|
+
<a id="symbol-_tensor"></a>
|
|
34
|
+
## `_tensor` · [source](api.aug#L5)
|
|
35
|
+
|
|
36
|
+
It is private to its defining scope. It takes `values` as `List<float>`. It returns ownership of [`Tensor`](bindings.aug.md#symbol-Tensor). Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
37
|
+
|
|
38
|
+
Native implementation: `@greenpandastudios/aug-pytorch@0.1.4`, `2.14.1`. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5`). It calls `aug_torch_tensor_from_f64_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. The caller owns the returned handle. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
|
|
39
|
+
|
|
40
|
+
<a id="symbol-_add"></a>
|
|
41
|
+
## `_add` · [source](api.aug#L6)
|
|
42
|
+
|
|
43
|
+
It is private to its defining scope. It takes `left` and `right` as [`Tensor`](bindings.aug.md#symbol-Tensor). It returns ownership of [`Tensor`](bindings.aug.md#symbol-Tensor). Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
44
|
+
|
|
45
|
+
Native implementation: `@greenpandastudios/aug-pytorch@0.1.4`, `2.14.1`. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5`). It calls `aug_torch_tensor_add_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. `left` lends read access for this call; `right` lends read access for this call. The caller owns the returned handle. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
|
|
46
|
+
|
|
47
|
+
<a id="symbol-_sum"></a>
|
|
48
|
+
## `_sum` · [source](api.aug#L7)
|
|
49
|
+
|
|
50
|
+
It is private to its defining scope. It takes `tensor` as [`Tensor`](bindings.aug.md#symbol-Tensor). It returns `float`. Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
51
|
+
|
|
52
|
+
Native implementation: `@greenpandastudios/aug-pytorch@0.1.4`, `2.14.1`. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5`). It calls `aug_torch_tensor_sum_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. `tensor` lends read access for this call. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
|
|
53
|
+
|
|
54
|
+
<a id="symbol-_values"></a>
|
|
55
|
+
## `_values` · [source](api.aug#L8)
|
|
56
|
+
|
|
57
|
+
It is private to its defining scope. It takes `tensor` as [`Tensor`](bindings.aug.md#symbol-Tensor). It returns `List<float>`. Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
58
|
+
|
|
59
|
+
Native implementation: `@greenpandastudios/aug-pytorch@0.1.4`, `2.14.1`. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5`). It calls `aug_torch_tensor_values_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. `tensor` lends read access for this call. August copies the returned buffer, then calls `aug_torch_values_release_v1` to release it. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
|
|
60
|
+
|
|
61
|
+
<a id="symbol-_liveTensors"></a>
|
|
62
|
+
## `_liveTensors` · [source](api.aug#L26)
|
|
63
|
+
|
|
64
|
+
It is private to its defining scope. It returns `int`.
|
|
65
|
+
|
|
66
|
+
Native implementation: `@greenpandastudios/aug-pytorch@0.1.4`, `2.14.1`. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5`). It calls `aug_probe_live_tensors_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
|
|
67
|
+
|
|
68
|
+
<a id="symbol-_liveBuffers"></a>
|
|
69
|
+
## `_liveBuffers` · [source](api.aug#L27)
|
|
70
|
+
|
|
71
|
+
It is private to its defining scope. It returns `int`.
|
|
72
|
+
|
|
73
|
+
Native implementation: `@greenpandastudios/aug-pytorch@0.1.4`, `2.14.1`. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5`). It calls `aug_probe_live_buffers_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
|
|
74
|
+
|
|
75
|
+
<a id="symbol-_consumeAndFail"></a>
|
|
76
|
+
## `_consumeAndFail` · [source](api.aug#L29)
|
|
77
|
+
|
|
78
|
+
It is private to its defining scope. It takes `value` as [`Tensor`](bindings.aug.md#symbol-Tensor) with ownership transferred. Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError). It raises a [`TensorError`](contracts.aug.md#symbol-TensorError) with `code` `99` and `message` `"expected cleanup test"`.
|
|
79
|
+
|
|
80
|
+
<a id="symbol-_TensorContainer"></a>
|
|
81
|
+
## `_TensorContainer` · interface · [source](api.aug#L32)
|
|
82
|
+
|
|
83
|
+
It is private to this file.
|
|
84
|
+
|
|
85
|
+
<a id="symbol-_TensorContainer.total"></a>
|
|
86
|
+
### `_TensorContainer.total` · [source](api.aug#L33)
|
|
87
|
+
|
|
88
|
+
It returns `float`. Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError).
|
|
89
|
+
|
|
90
|
+
<a id="symbol-_TensorHolder"></a>
|
|
91
|
+
## `_TensorHolder` · class · [source](api.aug#L34)
|
|
92
|
+
|
|
93
|
+
It implements [`_TensorContainer`](api.aug.md#symbol-_TensorContainer). It is private to this file. It takes `item` as [`Tensor`](bindings.aug.md#symbol-Tensor) with ownership transferred, kept mutable.
|
|
94
|
+
|
|
95
|
+
<a id="symbol-_TensorHolder.total"></a>
|
|
96
|
+
### `_TensorHolder.total` · [source](api.aug#L35)
|
|
97
|
+
|
|
98
|
+
Failures can raise [`TensorError`](contracts.aug.md#symbol-TensorError). It returns [`sum`](api.aug.md#symbol-sum) with `tensor` from `item`.
|
|
99
|
+
|
|
100
|
+
<a id="symbol-_replace"></a>
|
|
101
|
+
## `_replace` · [source](api.aug#L37)
|
|
102
|
+
|
|
103
|
+
It is private to its defining scope. It takes `holder` as [`_TensorHolder`](api.aug.md#symbol-_TensorHolder) with permission to mutate it during the call and `replacement` as [`Tensor`](bindings.aug.md#symbol-Tensor) with ownership transferred. It may change `holder`. It sets `holder.item` to `replacement`.
|
|
104
|
+
|
|
105
|
+
<a id="symbol-test tensor"></a>
|
|
106
|
+
## `test tensor` · [source](api.aug#L41)
|
|
107
|
+
|
|
108
|
+
Tests [`tensor`](api.aug.md#symbol-tensor). Each case gets fresh setup and dependencies.
|
|
109
|
+
|
|
110
|
+
### `cpu`
|
|
111
|
+
|
|
112
|
+
#### `adds_real_tensors` · [source](api.aug#L43)
|
|
113
|
+
|
|
114
|
+
It sets `left` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `1.0`, `2.0`, `3.0`. `left` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value. It sets `right` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `4.0`, `5.0`, `6.0`. `right` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value.
|
|
115
|
+
|
|
116
|
+
It sets `result` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`add`](api.aug.md#symbol-add) with `left` and `right`. `result` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value. The test requires [`sum`](api.aug.md#symbol-sum) with `tensor` from `result` equals `21.0`. It sets `output` of type `List<float>` to [`values`](api.aug.md#symbol-values) with `tensor` from `result`.
|
|
117
|
+
|
|
118
|
+
The test requires `output.length` equals `3`.
|
|
119
|
+
|
|
120
|
+
### `ownership`
|
|
121
|
+
|
|
122
|
+
#### `transfers_into_a_field_and_releases_the_old_tensor` · [source](api.aug#L52)
|
|
123
|
+
|
|
124
|
+
It sets `before` to `0`. Within an unsafe block, it gets `before` from [`_liveTensors`](api.aug.md#symbol-_liveTensors). Native operations must satisfy their declared C contracts. Within a task and ownership scope, it sets `initial` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `1.0`.
|
|
125
|
+
|
|
126
|
+
`initial` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value. It sets `holder` of type [`_TensorHolder`](api.aug.md#symbol-_TensorHolder) to a [`_TensorHolder`](api.aug.md#symbol-_TensorHolder) with `item` from `initial`. `holder` of type [`_TensorHolder`](api.aug.md#symbol-_TensorHolder) owns this value. It sets `replacement` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `7.0`.
|
|
127
|
+
|
|
128
|
+
`replacement` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value. With temporary permission to change `holder`, it calls [`_replace`](api.aug.md#symbol-_replace) with `holder` and `replacement`. The test requires [`holder.total`](api.aug.md#symbol-_TensorHolder.total) equals `7.0`. Within an unsafe block, the test requires [`_liveTensors`](api.aug.md#symbol-_liveTensors) equals (`before` plus `1`).
|
|
129
|
+
|
|
130
|
+
Native operations must satisfy their declared C contracts. On leaving this scope, join its child tasks and release its local values. Within an unsafe block, the test requires [`_liveTensors`](api.aug.md#symbol-_liveTensors) equals `before`. Native operations must satisfy their declared C contracts.
|
|
131
|
+
|
|
132
|
+
#### `preserves_native_error_methods` · [source](api.aug#L67)
|
|
133
|
+
|
|
134
|
+
It sets `caught` to `false`. It sets `left` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `1.0`, `2.0`. `left` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value. It sets `right` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `1.0`, `2.0`, `3.0`.
|
|
135
|
+
|
|
136
|
+
`right` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value.
|
|
137
|
+
|
|
138
|
+
It tries to call [`add`](api.aug.md#symbol-add) with `left` and `right`. If this work raises [`TensorError`](contracts.aug.md#symbol-TensorError) as `error`, it sets `caught` to `length` on `error.explain` is positive. The test requires `caught` is true.
|
|
139
|
+
|
|
140
|
+
#### `releases_a_transferred_tensor_when_the_callee_fails` · [source](api.aug#L76)
|
|
141
|
+
|
|
142
|
+
It sets `before` to `0`. Within an unsafe block, it gets `before` from [`_liveTensors`](api.aug.md#symbol-_liveTensors). Native operations must satisfy their declared C contracts. It sets `caught` to `false`.
|
|
143
|
+
|
|
144
|
+
It sets `value` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `1.0`. `value` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value. It calls [`_consumeAndFail`](api.aug.md#symbol-_consumeAndFail) with `value`. If this work raises [`TensorError`](contracts.aug.md#symbol-TensorError) as `error`, it sets `caught` to `error.code` equals `99`.
|
|
145
|
+
|
|
146
|
+
The test requires `caught` is true. Within an unsafe block, the test requires [`_liveTensors`](api.aug.md#symbol-_liveTensors) equals `before`; then the test requires [`_liveBuffers`](api.aug.md#symbol-_liveBuffers) equals `0`. Native operations must satisfy their declared C contracts.
|
|
147
|
+
|
|
148
|
+
#### `releases_scoped_and_unused_results` · [source](api.aug#L90)
|
|
149
|
+
|
|
150
|
+
It sets `before` to `0`. Within an unsafe block, it gets `before` from [`_liveTensors`](api.aug.md#symbol-_liveTensors). Native operations must satisfy their declared C contracts. Within a task and ownership scope, it sets `value` of type [`Tensor`](bindings.aug.md#symbol-Tensor) to [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `2.0`.
|
|
151
|
+
|
|
152
|
+
`value` of type [`Tensor`](bindings.aug.md#symbol-Tensor) owns this value. It sets `output` of type `List<float>` to [`values`](api.aug.md#symbol-values) with `tensor` from `value`. The test requires `output.get` with `index` `0` equals `2.0`. On leaving this scope, join its child tasks and release its local values.
|
|
153
|
+
|
|
154
|
+
It calls [`tensor`](api.aug.md#symbol-tensor) with `values` from a list containing `3.0`. Within an unsafe block, the test requires [`_liveTensors`](api.aug.md#symbol-_liveTensors) equals `before`; then the test requires [`_liveBuffers`](api.aug.md#symbol-_liveBuffers) equals `0`. Native operations must satisfy their declared C contracts.
|
|
155
|
+
|
|
156
|
+
## Dependencies
|
|
157
|
+
|
|
158
|
+
It uses [`Tensor`](bindings.aug.md#symbol-Tensor) from `bindings`. It uses [`TensorError`](contracts.aug.md#symbol-TensorError) from `contracts`.
|
|
159
|
+
|
|
160
|
+
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<!-- Generated by aug spec. Edit the August source, then regenerate. -->
|
|
2
|
+
|
|
3
|
+
# `bindings.aug`
|
|
4
|
+
|
|
5
|
+
<a id="symbol-Tensor"></a>
|
|
6
|
+
## `Tensor` · native resource · [source](bindings.aug#L3)
|
|
7
|
+
|
|
8
|
+
Native implementation: `@greenpandastudios/aug-pytorch@0.1.4`, `2.14.1`. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5`). An owned value releases its opaque handle through `aug_torch_tensor_release_v1` when its scope ends, including error and return paths.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Generated by aug spec. This is a copy of the installed dependency source.
|
|
2
|
+
// aug-spec: "contracts.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
3
|
+
TensorError(int code, string message) implements Error:
|
|
4
|
+
/** Explain the native failure without losing its original message. */
|
|
5
|
+
explain() returns string:
|
|
6
|
+
return message
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Generated by aug spec. Edit the August source, then regenerate. -->
|
|
2
|
+
|
|
3
|
+
# `contracts.aug`
|
|
4
|
+
|
|
5
|
+
<a id="symbol-TensorError"></a>
|
|
6
|
+
## `TensorError` · class · [source](contracts.aug#L3)
|
|
7
|
+
|
|
8
|
+
It implements `Error`. It takes `code` as an integer, kept read-only and `message` as a string, kept read-only.
|
|
9
|
+
|
|
10
|
+
<a id="symbol-TensorError.explain"></a>
|
|
11
|
+
### `TensorError.explain` · [source](contracts.aug#L5)
|
|
12
|
+
|
|
13
|
+
Explain the native failure without losing its original message. It returns `message`.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": 1,
|
|
3
|
+
"profile": "aug-native-abi-1",
|
|
4
|
+
"resources": [
|
|
5
|
+
{
|
|
6
|
+
"module": "bindings",
|
|
7
|
+
"name": "Tensor",
|
|
8
|
+
"release": "aug_torch_tensor_release_v1"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"functions": [
|
|
12
|
+
{
|
|
13
|
+
"module": "api",
|
|
14
|
+
"name": "_tensor",
|
|
15
|
+
"symbol": "aug_torch_tensor_from_f64_v1",
|
|
16
|
+
"params": [
|
|
17
|
+
{
|
|
18
|
+
"name": "values",
|
|
19
|
+
"kind": "f64-list"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"result": {
|
|
23
|
+
"kind": "resource",
|
|
24
|
+
"resource": "bindings.Tensor"
|
|
25
|
+
},
|
|
26
|
+
"error": "contracts.TensorError",
|
|
27
|
+
"callingConvention": "C",
|
|
28
|
+
"status": "i32",
|
|
29
|
+
"uses": [],
|
|
30
|
+
"changes": [],
|
|
31
|
+
"thread": "caller",
|
|
32
|
+
"retainsInputs": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"module": "api",
|
|
36
|
+
"name": "_add",
|
|
37
|
+
"symbol": "aug_torch_tensor_add_v1",
|
|
38
|
+
"params": [
|
|
39
|
+
{
|
|
40
|
+
"name": "left",
|
|
41
|
+
"kind": "resource",
|
|
42
|
+
"resource": "bindings.Tensor",
|
|
43
|
+
"ownership": "read"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "right",
|
|
47
|
+
"kind": "resource",
|
|
48
|
+
"resource": "bindings.Tensor",
|
|
49
|
+
"ownership": "read"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"result": {
|
|
53
|
+
"kind": "resource",
|
|
54
|
+
"resource": "bindings.Tensor"
|
|
55
|
+
},
|
|
56
|
+
"error": "contracts.TensorError",
|
|
57
|
+
"callingConvention": "C",
|
|
58
|
+
"status": "i32",
|
|
59
|
+
"uses": [],
|
|
60
|
+
"changes": [],
|
|
61
|
+
"thread": "caller",
|
|
62
|
+
"retainsInputs": false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"module": "api",
|
|
66
|
+
"name": "_sum",
|
|
67
|
+
"symbol": "aug_torch_tensor_sum_v1",
|
|
68
|
+
"params": [
|
|
69
|
+
{
|
|
70
|
+
"name": "tensor",
|
|
71
|
+
"kind": "resource",
|
|
72
|
+
"resource": "bindings.Tensor",
|
|
73
|
+
"ownership": "read"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"result": {
|
|
77
|
+
"kind": "f64"
|
|
78
|
+
},
|
|
79
|
+
"error": "contracts.TensorError",
|
|
80
|
+
"callingConvention": "C",
|
|
81
|
+
"status": "i32",
|
|
82
|
+
"uses": [],
|
|
83
|
+
"changes": [],
|
|
84
|
+
"thread": "caller",
|
|
85
|
+
"retainsInputs": false
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"module": "api",
|
|
89
|
+
"name": "_values",
|
|
90
|
+
"symbol": "aug_torch_tensor_values_v1",
|
|
91
|
+
"params": [
|
|
92
|
+
{
|
|
93
|
+
"name": "tensor",
|
|
94
|
+
"kind": "resource",
|
|
95
|
+
"resource": "bindings.Tensor",
|
|
96
|
+
"ownership": "read"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"result": {
|
|
100
|
+
"kind": "f64-list",
|
|
101
|
+
"release": "aug_torch_values_release_v1"
|
|
102
|
+
},
|
|
103
|
+
"error": "contracts.TensorError",
|
|
104
|
+
"callingConvention": "C",
|
|
105
|
+
"status": "i32",
|
|
106
|
+
"uses": [],
|
|
107
|
+
"changes": [],
|
|
108
|
+
"thread": "caller",
|
|
109
|
+
"retainsInputs": false
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"module": "api",
|
|
113
|
+
"name": "_liveTensors",
|
|
114
|
+
"symbol": "aug_probe_live_tensors_v1",
|
|
115
|
+
"params": [],
|
|
116
|
+
"result": {
|
|
117
|
+
"kind": "i64"
|
|
118
|
+
},
|
|
119
|
+
"callingConvention": "C",
|
|
120
|
+
"status": "direct",
|
|
121
|
+
"uses": [],
|
|
122
|
+
"changes": [],
|
|
123
|
+
"thread": "caller",
|
|
124
|
+
"retainsInputs": false
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"module": "api",
|
|
128
|
+
"name": "_liveBuffers",
|
|
129
|
+
"symbol": "aug_probe_live_buffers_v1",
|
|
130
|
+
"params": [],
|
|
131
|
+
"result": {
|
|
132
|
+
"kind": "i64"
|
|
133
|
+
},
|
|
134
|
+
"callingConvention": "C",
|
|
135
|
+
"status": "direct",
|
|
136
|
+
"uses": [],
|
|
137
|
+
"changes": [],
|
|
138
|
+
"thread": "caller",
|
|
139
|
+
"retainsInputs": false
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Working on this August project
|
|
2
|
+
|
|
3
|
+
Read each file's adjacent `.aug.md` before editing; change `.aug` source and regenerate with `aug spec .`.
|
|
4
|
+
This project imports real CPU LibTorch through a tagged public package. Keep dependency versions and native ownership explicit. Do not replace native operations with a mock.
|
|
5
|
+
Use the August 0.21.0 LLVM preview on macOS 14+ ARM64. Run `aug install .`, `aug check .`, `aug test .`, and `aug run .`. Consumer installation must not invoke native build scripts.
|