At least for now we still somewhat pretend to have a linear version
history so we want to include this in future releases.
changelog_begin
changelog_end
* Port PerformanceEnvelope.TransactionSize perf test from Canton
to LedgerApiTestTool --perf-tests
changelog_begin
[Ledger Api Test Tool] Added the TransactionSize performance benchmark test.
changelog_end
* Review feedback from Samir
* Formatting
This is the first part of #5700
It adds tests that build create-daml-app using `daml build` and then
run the codegen and build the UI. Contrary to our main tests these
also run on Windows. This is actually reasonably simple by first
building the typescript libraries on Linux and then downloading them
on Windows.
There are two parts that are still missing from the tests in the main
workspace:
1. Building the extra feature. This should be fairly easy to add.
2. Running the pupeeter tests. At least MacOS and Linux should be
reasonably easy. I don’t know what horrors Windows will throw at
us. This step is what actually makes this a compatibility
test. Currently it doesn’t actually launch Sandbox and the JSON API.
Since this PR is already pretty large, I’d like to tackle those things
separately.
changelog_begin
changelog_end
patch Bazel on Windows (ci setup)
We have a weird, intermittent bug on Windows where Bazel gets into a
broken state. To investigate, we need to patch Bazel to add more debug
output than present in the official distribution. This PR adds the basic
infrastructure we need to download the Bazel source code, apply a patch,
compile it, and make that binary available to the rest of the build.
This is for Windows only as we already have the ability to do similar
things on Linux and macOS through Nix.
This PR does not contain any intresting patch to Bazel, just the minimum
that we can check we are actually using the patched version.
CHANGELOG_BEGIN
CHANGELOG_END
* Extract caching from participant-state as a library
This will be used to keep a cache of values to cut on LF translation cost when serving transactions.
changelog_begin
changelog_end
* Add dependency where missing
* Updates to support VMWare vairant of Hypervisor
* Update infra/macos/scripts/rebuild-crontask.sh
Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
* Update infra/macos/scripts/run-agent.sh
Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
changelog_begin
dlint: Change references to replicateM to replicateA; remove some Haskell-based rules that do not currently apply in DAML.
changelog_end
* Inline typeclasses and apply projections.
This draft PR:
* adds a Subst module for substitution within LF expressions.
This implementation piggybacks on the existing type
substition. But there are not enough tests yet.
* passes World data into the simplifier, in order to have
have the ability to inline functions (selectively)
* inlines typeclass dictionaries and projection functions
* beta reduces type lambdas (which are just ignored by
speedy afaik)
* beta reduces lambdas that are passed units or dictionaries
* runs the simplifier twice so it has a change to
perform the inlining, reduction, AND projection
-- this is probably avoidable by sequencing the
simplifier steps in a specific order, but running
the simplifier twice is simple enough for now.
* together, these fix#5748 (see result on a toy module)
TODO:
* add lots of tests for Subst
* run this on a benchmark to see how big of a difference it makes.
* reduce the jankiness of running the simplifier twice.
Results:
DAML input:
```
module Main where
hello : Int
hello = 10 + 30
```
Original DAML-LF output:
```
module Main where
@location(7:0-7:5)
def hello : Int64 =
a284919a95c4a515cd1efac0d89be302d0e9d61e692a2176128c871ad8067e36:GHC.Num:+
@Int64
a284919a95c4a515cd1efac0d89be302d0e9d61e692a2176128c871ad8067e36:GHC.Num:$fAdditiveInt
10
30
```
Current DAML-LF output:
```
module Main where
@location(7:0-7:5)
def hello : Int64 = ADD_INT64 10 30
```
changelog_begin
changelog_end
* Update copyright header
* Lint
* More direct typeclass simplification
* extendWorldSelf + getTypeClassDictionary
* Fix visual
* Fix visual comment
* Disable cross-module inlining for incremental builds
* Cleanup subst/freevars.
* copyright header
* Alpha equivalence for LF expressions.
* copyright header
* lots of tests
* fix comment
* Apply review suggestions
- Disabled by default.
- Enabled with flags: `enableInstrumentation` and `enableLightweightStepTracing'
The instrumentation:
- tracks #pushes and maximum-depth for the `kont`-stack and the `env`ironment
- counts #steps
- classifies each step:
- for `CtrlExpr`, what kind of expression is it?
- for `CtrlValue`, what kind of continuation is at the head of the `kont`-stack?
- the information is printed when the machine finalizes
The lightweight tracing shows an abbreviated output line per step:
- the control expression / value
- the size of the environment
- the depth of the `kont`-stack
changelog_begin
changelog_end
This is temporary. It looks like the macOS nodes are dead; @nycnewman is
looking into it, but in case he doesn't fix it in time, at least we
have a backup plan so we're not completely blocked on Monday.
CHANGELOG_BEGIN
CHANGELOG_END
add default machine capability
We semi-regularly need to do work that has the potential to disrupt a
machine's local cache, rendering it broken for other streams of work.
This can include upgrading nix, upgrading Bazel, debugging caching
issues, or anything related to Windows.
Right now we do not have any good solution for these situations. We can
either not do those streams of work, or we can proceed with them and
just accept that all other builds may get affected depending on which
machine they get assigned to. Debugging broken nodes is particularly
tricky as we do not have any way to force a build to run on a given
node.
This PR aims at providing a better alternative by (ab)using an Azure
Pipelines feature called
[capabilities](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser#capabilities).
The idea behind capabilities is that you assign a set of tags to a
machine, and then a job can express its
[demands](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/demands?view=azure-devops&tabs=yaml),
i.e. specify a set of tags machines need to have in order to run it.
Support for this is fairly badly documented. We can gather from the
documentation that a job can specify two things about a capability
(through its `demands`): that a given tag exists, and that a given tag
has an exact specified value. In particular, a job cannot specify that a
capability should _not_ be present, meaning we cannot rely on, say,
adding a "broken" tag to broken machines.
Documentation on how to set capabilities for an agent is basically
nonexistent, but [looking at the
code](https://github.com/microsoft/azure-pipelines-agent/blob/master/src/Microsoft.VisualStudio.Services.Agent/Capabilities/UserCapabilitiesProvider.cs)
indicates that they can be set by using a simple `key=value`-formatted
text file, provided we can find the right place to put this file.
This PR adds this file to our Linux, macOS and Windows node init scripts
to define an `assignment` capability and adds a demand for a `default`
value on each job. From then on, when we hit a case where we want a PR
to run on a specific node, and to prevent other PRs from running on that
node, we can manually override the capability from the Azure UI and
update the demand in the relevant YAML file in the PR.
CHANGELOG_BEGIN
CHANGELOG_END
* postgresql-testing: Store the JDBC URL separately.
* postgresql-testing: Expose the username and password.
* postgresql-testing: Get the caller to create the database.
And make sure it's a random one, not "test".
CHANGELOG_BEGIN
CHANGELOG_END
* postgresql-testing: Only store the JDBC URL for tests.
Less mutable state, innit.
* postgresql-testing: Capture the individual JDBC URL parameters.
* Bazel: Fix PostgreSQL binary paths.
* postgresql-testing: Just recreate the database in PostgresAroundEach.
There's no need to restart the process with a different data directory.
This means we can remove the dependency on `silencer-lib`, which means
that users don't have to upgrade to Scala v2.12.11.
CHANGELOG_BEGIN
- [Scala Bindings]: We no longer require users to upgrade to Scala
v2.12.11.
CHANGELOG_END
I’m not entirely sure why people end up with poisoned nix
caches (seems harder than poisoning your Bazel cache) but a few people
have managed apparently so this should hopefully help them recover.
changelog_begin
changelog_end
We add a new traversels to GenTransaction that visit all the nodes in execution order.
Exercise nodes are visited twice: when execution reaches them and when execution leaves their body.
CHANGELOG_BEGIN
CHANGELOG_END
This PR changes the notify_user job to not run when the job has been
canceled, which happens mostly when we push new code.
Not sure how I failed to see the `canceled` function in the past, but
this does seem to do exactly what we want.
CHANGELOG_BEGIN
CHANGELOG_END
* Use a table specifically for transaction trees witnesses
This allows to not re-compute those every time using the flat transaction
witnesses and the complement.
Furthermore, witness tables indexing is redefined to a single primary key
covering both event identifier and witness party instead of two
separated indexes. This has proven to be a relevant improvement for
performance.
Fixes#5883
changelog_begin
[Ledger API Server] Significant improvements in serving transaction trees. See #5883.
changelog_end
* Fix migration SHA
Fixes#5786.
CHANGELOG_BEGIN
[DAML Standard Lib] ``DA.Text.splitOn`` will now correctly handle the
case where the separator appears at the end but should not be matched,
as in ``splitOn "aa" "aaa" == ["", "a"]`` (previously this was
erroneously returning ``["", "a", ""]``). See #5786 for more details.
CHANGELOG_END
- Have a special continuation `KFinished` which is pushed on the initially empty `kontStack`.
- `KFinished.execute` throws `SpeedyHungry` when it has the `SResultFinalValue`.
- This unifies the behaviour w.r.t other kinds of `SResult`.
- The `kontStack` is never empty during evaluation.
- So we no longer require an`isFinal` test, and so the inner loop is a little tighter.
The performance improvement here is marginal (1% maybe). But the clarity is better. Also, it's a nice invariant that there is always at least one continuation on the stack. An invariant which will be useful in a change planned to improve handling of `KPop` and `KLocation`.
changelog_begin
changelog_end
This PR separates the "last known valid perf test" commit from the
"baseline speedy implementation" commit. It is important for the perf
test to be meaningful that the changes between those two commits are
benign, say minor API adjustments, so that the perf measurement remains
meaningful.
This also adds a check on merging to master that tells Slack if the perf
test has changed and the `test_sha` file needs updating. The Slack
message is conditional on the current commit to avoid excessive noise.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-on-sql: Use dedicated database execution contexts.
This may or may not stop us from monopolizing API server threads.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-on-sql: Name arguments to `Database` and `UninitializedDatabase`.
bazel configuration does two things:
It modifies .bazelrc.local and it writes a temp file.
I’ve run `git clean` on a PR. This caused the temp file to be
removed. However `.bazelrc.local` stayed since it is in
`.gitignore`. This meant that the next time the formatting check ran
the `.bazelrc.local` pointed to the temp file but the temp file was no
longer there.
changelog_begin
changelog_end
* Simplify and clarify the public interface to Speedy.
- Remove `isFinal`. A client just uses `run()`.
- Remove `toSValue`. The value in available in `SResultFinalValue(v: SValue)`.
- A client never directly access the `.ctrl` (or `.returnValue`) components.
- A client may use `setExpressionToEvaluate(expr)` to evaluate a new expression on an existing machine.
changelog_begin
changelog_end
* remove while loop which executes just once
* avoid unnecessary mutation when running speedy