Skip to content

feat(zoe): zoe part of minimal want patterns using M.containerHas(el,n) #10952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: markm-want-patterns-only-ertp
Choose a base branch
from

Conversation

erights
Copy link
Member

@erights erights commented Feb 5, 2025

Staged on #11235 , which provides the E part

closes: #XXXX
refs: endojs/endo#2710 #1905 #1913 #1915 #2155 #2156 #2230 #4212 #4217 #10951 #11235

Description

Implements minimal want patterns, where the only supported pattern is M.containerHas

  • Zoe-level changes to accept want patterns

Security Considerations

none

Scaling Considerations

By allowing want patterns, might this make the processing of wants more expensive?

Documentation Considerations

Need to update the Zoe API docs to explain want-patterns

Testing Considerations

  • Need to add Zoe tests once the Zoe changes are in

Upgrade Considerations

None

  • Need to update NEWS.md for Zoe

Copy link

cloudflare-workers-and-pages bot commented Feb 5, 2025

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: e13d700
Status:🚫  Build failed.

View logs

@erights erights force-pushed the markm-min-want-patterns-3 branch 5 times, most recently from ffd5cdd to b2b30dc Compare February 11, 2025 01:38
@erights erights force-pushed the markm-min-want-patterns-3 branch 2 times, most recently from a2c8801 to b8ebc19 Compare March 13, 2025 21:39
@erights erights force-pushed the markm-min-want-patterns-3 branch 2 times, most recently from c1fbfcf to 3698a77 Compare March 14, 2025 21:01
@erights erights changed the title feat(ertp,zoe): minimal want patterns using M.has(el,n) feat(ertp,zoe): minimal want patterns using M.containerHas(el,n) Mar 18, 2025
@erights erights force-pushed the markm-min-want-patterns-3 branch from a04ee47 to 20b287d Compare March 18, 2025 18:46
erights added a commit to endojs/endo that referenced this pull request Mar 19, 2025
Closes: #XXXX
Refs: #2002 #2008 #2113 #1739
Agoric/agoric-sdk#10952

## Description

This PR adds a new `M.containerHas(elementPatt, positiveBigint)`
matcher, and exported `containerHasSplit` function. This is motivated to
support Agoric/agoric-sdk#10952 , which
introduces a minimal form of want pattern in terms of `M.containerHas`.

- [x] Actually merging this must happen only after we've decided either
to move forward with #2008 or to give up on it. Once a decision is made,
and even before it is acted on, then this PR can move forward. (Any
decision to move forward or not with #2008 should also consider changing
the default of the feature flag introduced by #2002 .)

### Security Considerations

none

### Scaling Considerations

Might help due to early termination of the split operations, which
Agoric/agoric-sdk#10952 uses for
`AmountMath.isGTE`.

### Documentation Considerations

Already doc-documents `M.containerHas` in the types.js file for `M`.
That's probably good enough for this PR. The interesting documentation
will be explaining want patterns in
Agoric/agoric-sdk#10952

### Testing Considerations

Added tests for `M.containerHas`

### Compatibility Considerations

The reason to postpone merging this PR until decisions are made on #2008
is that this PR will further expose `rankOrder` in the API, amplifying
the danger that changing the string order will cause surprising
observable changes.

### Upgrade Considerations

This PR itself does not introduce any BREAKING changes or Upgrade
issues.

- [x] Update `NEWS.md` for user-facing changes.
@erights erights force-pushed the markm-min-want-patterns-3 branch from 1efc171 to 27b3006 Compare March 22, 2025 16:10
@erights erights changed the base branch from master to markm-zoe-types-gardening March 22, 2025 16:11
@erights erights force-pushed the markm-zoe-types-gardening branch from bc8b038 to bbd4873 Compare March 22, 2025 17:03
Base automatically changed from markm-zoe-types-gardening to master March 22, 2025 19:35
Copy link

Base branch is changed to master. Please re-run the integration tests by adding 'force:integration' label.

@erights erights force-pushed the markm-min-want-patterns-3 branch 2 times, most recently from a91d27c to 28f79dd Compare March 24, 2025 22:51
kriskowal added a commit to endojs/endo that referenced this pull request Mar 24, 2025
# `ses` v1.12.0

- The `evalTaming:` option values are renamed:

  - from `'safeEval'`, `'unsafeEval'`, and `'noEval'`
  - to `'safe-eval'`, `'unsafe-eval'`, and `'no-eval'`

in order to follow the convention that lockdown option values use
kebob-case rather than camelCase. To avoid breaking old programs during
the transition, the old names are deprecated, but continue to work for
now.

- The value of expressions like `typeof unlikelyGlobal` is now
`undefined` instead of producing a `ReferenceError` because it proves
impossible to do so without revealing what properties exist on the host
`globalThis` to compartmentalized code.

# `@endo/patterns` v1.5.0

- New pattern: `M.containerHas(elementPatt, bound = 1n)` motivated to
support want patterns in Zoe, to pull out only `bound` number of
elements that match `elementPatt`. `bound` must be a positive bigint.

- Closely related, `@endo/patterns` now exports `containerHasSplit` to
support ERTP's use of `M.containerHas` on non-fungible (`set`,
`copySet`) and semifungible (`copyBag`) assets, respectively. See
Agoric/agoric-sdk#10952 .

# `@endo/import-bundle` v1.4.0

- Adds support for `test` format bundles, which simply return a promise
for an object that resembles a module exports namespace with the objects
specified on the symbol-named property @exports, which is deliberately
not JSON serializable or passable.
- Adds a `typedImportBundle<ExpectedExportsNamespace>` function with a
proper type signature, to provide a narrower signature than `any`
without disrupting existing usage.

# `@endo/bundle-source` v4.0.0

- Replaces the implementation for the `nestedEvaluate` and `getExport`
formats with one based on Endo's Compartment Mapper instead of Rollup,
in order to obviate the need to reconcile source map transforms between
Rollup and the underlying Babel generator. As a consequence, we no
longer generate a source map for the bundle, but Babel ensures that we
preserve line and column numbers between the original source and the
bundled source.

# `@endo/compartment-mapper` v1.6.0

- Accommodates CommonJS modules that use `defineProperty` on `exports`.

- Divides the role of `makeBundle` into `makeScript` and `makeFunctor`.
The new `makeScript` replaces `makeBundle` without breaking changes,
producing a JavaScript string that is suitable as a `<script>` tag in a
web page.
- The new `makeFunctor` produces a JavaScript string that, when
evaluated, produces a partially applied function, so the caller can
provide runtime options.
- Both `makeScript` and `makeFunctor` now accept `format`, `useEvaluate`
and `sourceUrlPrefix` options.
- The functor produced by `makeFunctor` now accepts `evaluate`,
`require`, and `sourceUrlPrefix` runtime options.
- Both `makeScript` and `makeFunctor` now accept a `format` option.
Specifiying the `"cjs"` format allows the bundle to exit to the host's
CommonJS `require` for host modules.
- Adds `sourceDirname` to compartment descriptors in the compartment
maps generated by `mapNodeModules` and uses these to provide better
source URL comments for bundles generated by `makeScript` and
`makeFunctor`, by default.

These changes collectively allow us to replace the implementation of
`nestedEvaluate` and `getExports` formats in `@endo/bundle-source`,
including the preservation of useful line numbers and file names in
stack traces.

- `mapNodeModules`, `importLocation` and `loadLocation` now accept a
`log` option for users to define a custom logging function. As of this
writing, _only `mapNodeModules`_ will potentially call this function if
provided. Expansion of log messaging and support for the `log` option in
more APIs is expected _in the future_.

# `@endo/evasive-transform` v1.4.0

- Adds a `sourceMap` option so that the generated sourcemap can project
back to the original source code without `unmapLoc`.
- Removes support for sourcemap `unmapLoc` because it is not used by
contemporary Endo packages. The option is now ignored.
@erights erights force-pushed the markm-min-want-patterns-3 branch 2 times, most recently from 5260960 to 43794cc Compare March 25, 2025 14:04
@erights erights force-pushed the markm-min-want-patterns-3 branch 3 times, most recently from 7e865f7 to 113653c Compare April 8, 2025 01:33
@erights erights force-pushed the markm-min-want-patterns-3 branch 2 times, most recently from a1ed11d to 6f54123 Compare April 8, 2025 20:36
@erights erights changed the base branch from master to markm-want-patterns-only-ertp April 8, 2025 20:37
@erights erights force-pushed the markm-min-want-patterns-3 branch from 6f54123 to 67b544c Compare April 8, 2025 20:44
@erights erights changed the title feat(ertp,zoe): minimal want patterns using M.containerHas(el,n) zoe part of minimal want patterns using M.containerHas(el,n) Apr 8, 2025
@erights erights changed the title zoe part of minimal want patterns using M.containerHas(el,n) feat(zoe): zoe part of minimal want patterns using M.containerHas(el,n) Apr 8, 2025
@erights erights force-pushed the markm-want-patterns-only-ertp branch from ae6b40c to 2e4d932 Compare April 8, 2025 20:55
@erights erights force-pushed the markm-min-want-patterns-3 branch from 67b544c to 89b0caa Compare April 8, 2025 21:00
@erights erights force-pushed the markm-want-patterns-only-ertp branch from 2e4d932 to 979da2a Compare April 8, 2025 21:09
@erights erights force-pushed the markm-min-want-patterns-3 branch from 89b0caa to e13d700 Compare April 8, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant