Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.
Python calibrationclassificationdecision-modelhuggingfacejevmodernbertmultilingualnlppythonpytorchroutingtyped-decisionszero-shot
feat(java): batching and usage, a test suite, a CI lane, and nine review fixes
Adeshina Lasisi1cb7e4d27f67
diff --git a/.github/workflows/java.yml b/.github/workflows/java.ymlnew file mode 100644index 00000000..2f667fc6--- /dev/null+++ b/.github/workflows/java.yml@@ -0,0 +1,158 @@+name: Java++# Parity lane for laya-java. The fixtures under laya-java/fixtures are recorded FROM the Python+# `laya` package, so this runs on every push and pull request with no path filter: a change to+# laya/ that moves what the fixtures capture shows up here rather than as silent drift. Each run+# re-records them from the Python code at that commit and runs the Java tests against the fresh+# copies.+#+# ADVISORY, not blocking, for the same reason the .NET lane is: the Python package is the product+# and laya-java follows it, so a Python-side improvement must not be blocked on a port catching up.+# When this lane goes red the fix is a follow-up port, not a revert of the Python change.++on:+ pull_request:+ push:+ workflow_dispatch:++permissions:+ contents: read++concurrency:+ group: java-${{ github.event_name == 'pull_request' && github.ref || github.sha }}+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}++env:+ # transformers probes for TensorFlow at import; when TF is present its abseil runtime can+ # deadlock model construction. Laya is torch-only.+ USE_TF: "0"+ USE_TORCH: "1"+ TOKENIZERS_PARALLELISM: "false"++jobs:+ build:+ name: build + model-free tests+ runs-on: ubuntu-latest+ continue-on-error: true # advisory: see the header+ timeout-minutes: 25+ steps:+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0+ - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1+ with:+ distribution: temurin+ java-version: "17"+ cache: gradle++ # The model-free families need no checkpoint, so their drift is checked here. The rest are+ # left alone by the generator and reported as unverified; the parity job checks those.+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0+ with:+ python-version: "3.12"+ - name: Install the Python toolchain the fixtures were recorded with+ run: |+ python -m pip install --upgrade pip+ pip install "torch==2.14.0" --index-url https://download.pytorch.org/whl/cpu+ pip install -r laya-dotnet/tools/requirements-regen.txt+ - name: Model-free fixture drift vs. committed+ run: python laya-java/scripts/gen_fixtures.py --check --only python_json.json++ # -Werror is on, so this fails on a warning as well as an error.+ - name: Build (warnings are errors)+ working-directory: laya-java+ run: ./gradlew --no-daemon build -x test++ # Without LAYA_CHECKPOINTS the checkpoint-backed factories abort by assumption and the rest+ # run. `--min-tests` is what stops an aborted suite from looking like a pass.+ - name: Tests that need no model+ working-directory: laya-java+ run: ./gradlew --no-daemon test+ - name: Model-free suite was not vacuous+ if: ${{ !cancelled() }}+ run: >+ python laya-java/scripts/check_test_results.py+ laya-java/laya-java/build/test-results/test --min-tests 80 --allow-aborted++ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2+ if: ${{ failure() }}+ with:+ name: java-build-diagnostics+ path: laya-java/laya-java/build/reports++ parity:+ name: parity (${{ matrix.checkpoint }})+ runs-on: ubuntu-latest+ continue-on-error: true # advisory: see the header+ timeout-minutes: 75+ strategy:+ fail-fast: false+ matrix:+ checkpoint: [english, multilingual]+ steps:+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0+ with:+ python-version: "3.12"+ - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1+ with:+ distribution: temurin+ java-version: "17"+ cache: gradle+ - name: Install the Python toolchain the fixtures were recorded with+ run: |+ python -m pip install --upgrade pip+ pip install "torch==2.14.0" --index-url https://download.pytorch.org/whl/cpu+ pip install -r laya-dotnet/tools/requirements-regen.txt++ # The export is the slow part (download, trace, verify) and depends only on the pinned+ # revision, the exporter and the model definition, so that is the cache key.+ - name: Cache pinned Hugging Face downloads+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0+ with:+ path: ~/.cache/huggingface/hub+ key: laya-java-hf-${{ runner.os }}-${{ matrix.checkpoint }}-${{ hashFiles('laya-dotnet/tools/regen_golden.py') }}+ - name: Cache the exported graph+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0+ with:+ path: onnx-java/${{ matrix.checkpoint }}+ key: laya-java-onnx-${{ runner.os }}-${{ matrix.checkpoint }}-${{ hashFiles('scripts/export_onnx.py', 'laya/common.py', 'laya-dotnet/tools/requirements-regen.txt') }}++ - name: Download the checkpoint and export the fused graph+ run: python laya-java/scripts/prepare_checkpoint.py --checkpoint ${{ matrix.checkpoint }}++ # Re-recorded from the Python code at THIS commit, and `--strict` makes a family this job+ # could not regenerate an error: here, a skip means the download or export failed rather than+ # that the machine has no model.+ - name: Regenerate every fixture from Python+ env:+ LAYA_FIXTURE_CHECKPOINTS: ${{ github.workspace }}/checkpoints-java+ LAYA_ONNX_GRAPH: ${{ github.workspace }}/onnx-java/${{ matrix.checkpoint }}/laya.onnx+ LAYA_PREDICT_MODEL: ${{ matrix.checkpoint }}+ run: python laya-java/scripts/gen_fixtures.py --strict+ # Informational: float noise across platforms is expected in the model-backed family, and the+ # Java test's tolerance is the gate rather than byte equality of the file.+ - name: Fixture drift vs. committed (informational)+ run: |+ git --no-pager diff --stat -- laya-java/fixtures+ git status --short -- laya-java/fixtures++ - name: Run every test against the fresh fixtures+ working-directory: laya-java+ env:+ LAYA_CHECKPOINTS: ${{ github.workspace }}/checkpoints-java+ LAYA_ONNX_GRAPH: ${{ github.workspace }}/onnx-java/${{ matrix.checkpoint }}/laya.onnx+ run: ./gradlew --no-daemon test+ # A checkpoint-backed factory that aborts is not a pass. With the checkpoints present nothing+ # may abort, and the floor catches a suite that silently stopped registering its cases.+ - name: No parity test was skipped+ if: ${{ !cancelled() }}+ run: >+ python laya-java/scripts/check_test_results.py+ laya-java/laya-java/build/test-results/test --min-tests 200++ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2+ if: ${{ failure() }}+ with:+ name: java-parity-diagnostics-${{ matrix.checkpoint }}+ path: |+ laya-java/laya-java/build/reports+ laya-java/fixturesdiff --git a/.github/workflows/release-java.yml b/.github/workflows/release-java.ymlnew file mode 100644index 00000000..4e3b0d05--- /dev/null+++ b/.github/workflows/release-java.yml@@ -0,0 +1,116 @@+name: Release Java (laya-java)++# Tag a commit laya-java-v0.1.0 and push it; this runs the model-free tests, verifies the version+# matches the tag, builds the jars and publishes them to Maven Central.+#+# SET UP ONCE, and only the project owner can do it -- none of this is in the repository:+# 1. Verify the `com.convaiinnovations` namespace at https://central.sonatype.com. Maven Central+# will not accept a groupId whose domain or GitHub org has not been proven.+# 2. Create a Central portal user token and add it as MAVEN_CENTRAL_USERNAME and+# MAVEN_CENTRAL_PASSWORD in the repository secrets.+# 3. Create a PGP key, publish the public half to a keyserver, and add the ASCII-armoured+# private half as LAYA_SIGNING_KEY with its passphrase as LAYA_SIGNING_PASSWORD. Central+# rejects unsigned artifacts.+#+# Until those exist this workflow cannot run, and `build.gradle.kts` is written so that nothing+# else is affected: signing activates only when a key is present, so `./gradlew build` and+# `publishToMavenLocal` work for anyone.++on:+ push:+ tags: ["laya-java-v*"]+ workflow_dispatch:++permissions:+ contents: read++jobs:+ build:+ name: Build & verify artifacts+ runs-on: ubuntu-latest+ timeout-minutes: 25+ defaults:+ run:+ working-directory: laya-java+ steps:+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0+ - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1+ with:+ distribution: temurin+ java-version: "17"+ cache: gradle++ - name: Version matches tag+ if: startsWith(github.ref, 'refs/tags/laya-java-v')+ run: |+ tag="${GITHUB_REF_NAME#laya-java-v}"+ echo "tag=$tag"+ # The build takes its version from a Gradle property, so the tag IS the version and+ # there is no second copy to drift from it.+ echo "layaJavaVersion=$tag" >> gradle.properties+ grep layaJavaVersion gradle.properties++ # The model-free suite only: a release runner has no checkpoint, so the parity factories+ # abort. They are the Java lane's job, on every commit, and a release is cut from a commit+ # that lane already covered.+ - name: Model-free tests+ run: ./gradlew --no-daemon test+ - name: The suite was not vacuous+ run: >+ python3 scripts/check_test_results.py laya-java/build/test-results/test+ --min-tests 80 --allow-aborted++ - name: Build the jars+ run: ./gradlew --no-daemon build -x test++ - name: Install to the local repository, and show what a consumer would get+ run: |+ ./gradlew --no-daemon publishToMavenLocal+ find ~/.m2/repository/com/convaiinnovations -type f | sort+ cat ~/.m2/repository/com/convaiinnovations/laya-java/*/laya-java-*.pom++ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2+ with:+ name: laya-java-artifacts+ path: |+ laya-java/laya-java/build/libs/*.jar+ laya-java/laya-java-client/build/libs/*.jar++ central:+ name: Publish to Maven Central+ needs: build+ runs-on: ubuntu-latest+ timeout-minutes: 25+ # A manual gate, as the npm lane has: the one irreversible step in the pipeline, since a+ # version published to Central can never be replaced.+ environment: maven-central+ defaults:+ run:+ working-directory: laya-java+ steps:+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0+ - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1+ with:+ distribution: temurin+ java-version: "17"+ cache: gradle+ - name: Version from the tag+ run: |+ tag="${GITHUB_REF_NAME#laya-java-v}"+ echo "layaJavaVersion=$tag" >> gradle.properties+ - name: Refuse to publish a snapshot to Central+ run: |+ tag="${GITHUB_REF_NAME#laya-java-v}"+ case "$tag" in+ *-SNAPSHOT) echo "::error::$tag is a snapshot; Central takes releases only"; exit 1 ;;+ esac+ - name: Publish+ env:+ LAYA_SIGNING_KEY: ${{ secrets.LAYA_SIGNING_KEY }}+ LAYA_SIGNING_PASSWORD: ${{ secrets.LAYA_SIGNING_PASSWORD }}+ MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}+ MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}+ run: |+ test -n "$LAYA_SIGNING_KEY" || { echo "::error::LAYA_SIGNING_KEY is unset; see the header"; exit 1; }+ test -n "$MAVEN_CENTRAL_USERNAME" || { echo "::error::MAVEN_CENTRAL_USERNAME is unset; see the header"; exit 1; }+ ./gradlew --no-daemon publishAllPublicationsToCentralRepositorydiff --git a/laya-java/.gitignore b/laya-java/.gitignorenew file mode 100644index 00000000..2c75b472--- /dev/null+++ b/laya-java/.gitignore@@ -0,0 +1,4 @@+# Gradle build state and outputs. The wrapper itself (gradlew, gradlew.bat, gradle/wrapper) IS+# committed, because a build that cannot be reproduced from a clean checkout is not a build.+.gradle/+build/diff --git a/laya-java/build.gradle.kts b/laya-java/build.gradle.ktsindex 48899059..285a6898 100644--- a/laya-java/build.gradle.kts+++ b/laya-java/build.gradle.kts@@ -1,5 +1,7 @@plugins {`java-library`+ `maven-publish`+ signing}// JDK 17: the oldest LTS still receiving updates, and the first with records and sealed@@ -9,14 +11,20 @@ val javaRelease = 17subprojects {apply(plugin = "java-library")+ apply(plugin = "maven-publish")+ apply(plugin = "signing")group = "com.convaiinnovations"- version = "0.1.0-SNAPSHOT"+ version = providers.gradleProperty("layaJavaVersion").getOrElse("0.1.0-SNAPSHOT")repositories { mavenCentral() }extensions.configure<JavaPluginExtension> {toolchain { languageVersion.set(JavaLanguageVersion.of(javaRelease)) }+ // Maven Central requires both; they are also what makes the runtime readable from an IDE,+ // which matters more than usual here because the comments carry the parity reasoning.+ withSourcesJar()+ withJavadocJar()}tasks.withType<JavaCompile>().configureEach {@@ -27,13 +35,105 @@ subprojects {options.encoding = "UTF-8"}+ tasks.withType<Javadoc>().configureEach {+ (options as StandardJavadocDocletOptions).apply {+ encoding = "UTF-8"+ charSet = "UTF-8"+ // Javadoc's HTML checker is stricter than the compiler and fails on things that are+ // not defects; the compiler's -Werror is the gate that matters.+ addStringOption("Xdoclint:none", "-quiet")+ }+ }++ // A jar that is byte-identical from the same source, so a consumer can verify what they got.+ tasks.withType<AbstractArchiveTask>().configureEach {+ isPreserveFileTimestamps = false+ isReproducibleFileOrder = true+ }+tasks.withType<Test>().configureEach {useJUnitPlatform()testLogging { events("failed", "skipped") }+ // Passed through rather than inherited silently, so a lane that forgets them is a lane+ // whose parity tests abort loudly instead of one that quietly tests less.+ listOf("LAYA_CHECKPOINTS", "LAYA_ONNX_GRAPH", "LAYA_PREDICT_GOLDEN").forEach { name ->+ System.getenv(name)?.let { environment(name, it) }+ }}dependencies {"testImplementation"("org.junit.jupiter:junit-jupiter:5.11.4")"testRuntimeOnly"("org.junit.platform:junit-platform-launcher")}++ extensions.configure<PublishingExtension> {+ repositories {+ // The Central Portal's Maven-compatible staging endpoint, so publishing needs no+ // third-party Gradle plugin and therefore no extra build dependency to audit. A+ // maintainer who prefers the portal's own plugin can swap this block out; nothing else+ // in the build depends on it.+ //+ // NOT EXERCISED. Publishing needs a verified `com.convaiinnovations` namespace, a+ // Central token and a PGP key, all of which belong to the project owner, so this+ // configuration is written from Central's documented requirements and has never been+ // run. `publishToMavenLocal` is the part that is tested.+ maven {+ name = "Central"+ url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")+ credentials {+ username = providers.environmentVariable("MAVEN_CENTRAL_USERNAME").orNull+ password = providers.environmentVariable("MAVEN_CENTRAL_PASSWORD").orNull+ }+ }+ }+ publications {+ create<MavenPublication>("maven") {+ from(components["java"])+ pom {+ name.set(project.name)+ description.set(+ when (project.name) {+ "laya-java" ->+ "Laya on the JVM: a fast, local, non-autoregressive decision model " ++ "runtime (tokenizer, sequence builder, ONNX inference, typed answers)."+ else ->+ "HTTP client for a self-hosted laya-serve, sharing laya-java's " ++ "typed answers."+ }+ )+ url.set("https://github.com/NandhaKishorM/laya")+ licenses {+ license {+ name.set("Apache-2.0")+ url.set("https://www.apache.org/licenses/LICENSE-2.0")+ }+ }+ developers {+ developer {+ name.set("Convai Innovations")+ url.set("https://github.com/NandhaKishorM")+ }+ }+ scm {+ url.set("https://github.com/NandhaKishorM/laya")+ connection.set("scm:git:https://github.com/NandhaKishorM/laya.git")+ developerConnection.set("scm:git:ssh://[email protected]/NandhaKishorM/laya.git")+ }+ }+ }+ }+ }++ // Signing is required by Maven Central and impossible without the project's key, so it is+ // configured to activate only when one is supplied. `gradlew build` and+ // `publishToMavenLocal` therefore work for anyone; a release needs the maintainer.+ extensions.configure<SigningExtension> {+ val signingKey = providers.environmentVariable("LAYA_SIGNING_KEY").orNull+ val signingPassword = providers.environmentVariable("LAYA_SIGNING_PASSWORD").orNull+ isRequired = signingKey != null+ if (signingKey != null) {+ useInMemoryPgpKeys(signingKey, signingPassword)+ sign(extensions.getByType<PublishingExtension>().publications)+ }+ }}diff --git a/laya-java/fixtures/predict.json b/laya-java/fixtures/predict.jsonnew file mode 100644index 00000000..4c5128b7--- /dev/null+++ b/laya-java/fixtures/predict.json@@ -0,0 +1,1456 @@+{+ "checkpoint": "multilingual",+ "graph": "laya.onnx",+ "single": {+ "billing-mixed": {+ "state": "We were billed twice for March and want a refund today.",+ "lang": null,+ "questions": {+ "intent": {+ "type": "choice",+ "instructions": "What does the customer want?",+ "criteria": {+ "refund": "money back for a duplicate charge",+ "replace": "a replacement unit",+ "info": "an explanation only"+ }+ },+ "urgency": {+ "type": "score",+ "instructions": "How urgent is this?",+ "criteria": [+ "not urgent",+ "somewhat",+ "urgent",+ "critical"+ ]+ },+ "duplicate": {+ "type": "noul",+ "instructions": "The customer was charged more than once."+ }+ },+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 1.0,+ "replace": 0.0,+ "info": 0.0+ },+ "confidence": 1.0,+ "answer_confidence": 1.0,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgency": {+ "type": "score",+ "score": 1.3835,+ "legend": {+ "0": "not urgent",+ "1": "somewhat",+ "2": "urgent",+ "3": "critical"+ },+ "probabilities": {+ "0": 0.0521,+ "1": 0.6075,+ "2": 0.245,+ "3": 0.0954+ },+ "confidence": 0.2603,+ "answer_confidence": 0.6075,+ "action": {+ "act_probability": 1.0+ }+ },+ "duplicate": {+ "type": "noul",+ "noul": 0.9972,+ "confidence": 0.9972,+ "answer_confidence": 0.9972,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 141,+ "output_tokens": 0,+ "state_tokens": 12,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ "cjk": {+ "state": "我们三月份被重复扣费了两次,请今天退还。",+ "lang": "zh",+ "questions": {+ "intent": {+ "type": "choice",+ "instructions": "客户想要什么?",+ "criteria": {+ "refund": "退款",+ "replace": "更换"+ }+ },+ "holds": {+ "type": "noul",+ "instructions": "客户被重复扣费。"+ }+ },+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9999,+ "replace": 0.0001+ },+ "confidence": 0.9991,+ "answer_confidence": 0.9999,+ "action": {+ "act_probability": 1.0+ }+ },+ "holds": {+ "type": "noul",+ "noul": 0.9856,+ "confidence": 0.9856,+ "answer_confidence": 0.9856,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 83,+ "output_tokens": 0,+ "state_tokens": 15,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ "many-options": {+ "state": "The reply was polite but arrived nine days late.",+ "lang": null,+ "questions": {+ "grade": {+ "type": "choice",+ "instructions": "Grade the reply.",+ "criteria": {+ "g00": "grade band number 0",+ "g01": "grade band number 1",+ "g02": "grade band number 2",+ "g03": "grade band number 3",+ "g04": "grade band number 4",+ "g05": "grade band number 5",+ "g06": "grade band number 6",+ "g07": "grade band number 7",+ "g08": "grade band number 8",+ "g09": "grade band number 9",+ "g10": "grade band number 10",+ "g11": "grade band number 11",+ "g12": "grade band number 12",+ "g13": "grade band number 13"+ }+ }+ },+ "model": "laya-rl-agent-onnx",+ "answers": {+ "grade": {+ "type": "choice",+ "choice": "g01",+ "probabilities": {+ "g00": 0.0681,+ "g01": 0.3935,+ "g02": 0.0186,+ "g03": 0.0166,+ "g04": 0.0176,+ "g05": 0.0172,+ "g06": 0.0167,+ "g07": 0.0167,+ "g08": 0.0167,+ "g09": 0.0382,+ "g10": 0.0729,+ "g11": 0.0702,+ "g12": 0.0843,+ "g13": 0.1527+ },+ "confidence": 0.2286,+ "answer_confidence": 0.3935,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 165,+ "output_tokens": 0,+ "state_tokens": 10,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ "structured-state": {+ "state": {+ "order": 1182,+ "items": [+ "widget",+ "case"+ ],+ "charged": 2,+ "currency": "NGN",+ "note": null+ },+ "lang": null,+ "questions": {+ "double": {+ "type": "noul",+ "instructions": "This order was charged twice."+ },+ "band": {+ "type": "score",+ "instructions": "Rate the severity.",+ "criteria": [+ {+ "d": "none"+ },+ "minor",+ 3+ ]+ }+ },+ "model": "laya-rl-agent-onnx",+ "answers": {+ "double": {+ "type": "noul",+ "noul": 0.9999,+ "confidence": 0.9999,+ "answer_confidence": 0.9999,+ "action": {+ "act_probability": 1.0+ }+ },+ "band": {+ "type": "score",+ "score": 1.8251,+ "legend": {+ "0": "{\"d\": \"none\"}",+ "1": "minor",+ "2": "3"+ },+ "probabilities": {+ "0": 0.0172,+ "1": 0.1405,+ "2": 0.8423+ },+ "confidence": 0.5538,+ "answer_confidence": 0.8423,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 139,+ "output_tokens": 0,+ "state_tokens": 36,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ "long-state": {+ "state": "evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. ",+ "lang": null,+ "questions": {+ "intent": {+ "type": "choice",+ "instructions": "What should we do?",+ "criteria": {+ "refund": "send money back",+ "escalate": "pass to a human"+ }+ }+ },+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "escalate",+ "probabilities": {+ "refund": 0.1964,+ "escalate": 0.8036+ },+ "confidence": 0.2852,+ "answer_confidence": 0.8036,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 1024,+ "output_tokens": 0,+ "state_tokens": 1081,+ "state_tokens_dropped": 82,+ "truncated": true,+ "truncated_questions": [+ "intent"+ ]+ }+ },+ "unicode-mixed": {+ "state": "Refund 退款 استرداد वापसी 😀 now!",+ "lang": "ar",+ "questions": {+ "intent": {+ "type": "choice",+ "instructions": "Pick one.",+ "criteria": {+ "a": "first",+ "b": "second"+ }+ }+ },+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "a",+ "probabilities": {+ "a": 0.8326,+ "b": 0.1674+ },+ "confidence": 0.3484,+ "answer_confidence": 0.8326,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 29,+ "output_tokens": 0,+ "state_tokens": 11,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ }+ },+ "batch": [+ {+ "batch_size": null,+ "sort_by_length": false,+ "states": [+ "We were billed twice for March and want a refund today.",+ "我们三月份被重复扣费了两次,请今天退还。",+ "The reply was polite but arrived nine days late.",+ {+ "order": 1182,+ "items": [+ "widget",+ "case"+ ],+ "charged": 2,+ "currency": "NGN",+ "note": null+ },+ "evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. ",+ "Refund 退款 استرداد वापसी 😀 now!",+ "short one",+ "another short state",+ ""+ ],+ "questions": {+ "intent": {+ "type": "choice",+ "instructions": "What should we do?",+ "criteria": {+ "refund": "send money back",+ "escalate": "pass to a human",+ "ignore": "no action"+ }+ },+ "urgent": {+ "type": "noul",+ "instructions": "This needs a human today."+ }+ },+ "results": [+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9999,+ "escalate": 0.0,+ "ignore": 0.0+ },+ "confidence": 0.9995,+ "answer_confidence": 0.9999,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0283,+ "confidence": 0.9717,+ "answer_confidence": 0.9717,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 86,+ "output_tokens": 0,+ "state_tokens": 12,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9986,+ "escalate": 0.0001,+ "ignore": 0.0013+ },+ "confidence": 0.9899,+ "answer_confidence": 0.9986,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0251,+ "confidence": 0.9749,+ "answer_confidence": 0.9749,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 92,+ "output_tokens": 0,+ "state_tokens": 15,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.02,+ "escalate": 0.0219,+ "ignore": 0.9581+ },+ "confidence": 0.8154,+ "answer_confidence": 0.9581,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0417,+ "confidence": 0.9583,+ "answer_confidence": 0.9583,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 82,+ "output_tokens": 0,+ "state_tokens": 10,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9669,+ "escalate": 0.0055,+ "ignore": 0.0275+ },+ "confidence": 0.8541,+ "answer_confidence": 0.9669,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.2902,+ "confidence": 0.7098,+ "answer_confidence": 0.7098,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 134,+ "output_tokens": 0,+ "state_tokens": 36,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.0165,+ "escalate": 0.0737,+ "ignore": 0.9098+ },+ "confidence": 0.6852,+ "answer_confidence": 0.9098,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.9176,+ "confidence": 0.9176,+ "answer_confidence": 0.9176,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 2048,+ "output_tokens": 0,+ "state_tokens": 1081,+ "state_tokens_dropped": 89,+ "truncated": true,+ "truncated_questions": [+ "intent",+ "urgent"+ ]+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9989,+ "escalate": 0.0002,+ "ignore": 0.0009+ },+ "confidence": 0.9918,+ "answer_confidence": 0.9989,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.7928,+ "confidence": 0.7928,+ "answer_confidence": 0.7928,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 84,+ "output_tokens": 0,+ "state_tokens": 11,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.1705,+ "escalate": 0.1067,+ "ignore": 0.7229+ },+ "confidence": 0.2946,+ "answer_confidence": 0.7229,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.2339,+ "confidence": 0.7661,+ "answer_confidence": 0.7661,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 66,+ "output_tokens": 0,+ "state_tokens": 2,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.0447,+ "escalate": 0.2633,+ "ignore": 0.6921+ },+ "confidence": 0.3219,+ "answer_confidence": 0.6921,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.291,+ "confidence": 0.709,+ "answer_confidence": 0.709,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 68,+ "output_tokens": 0,+ "state_tokens": 3,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.2294,+ "escalate": 0.0721,+ "ignore": 0.6984+ },+ "confidence": 0.2918,+ "answer_confidence": 0.6984,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.6362,+ "confidence": 0.6362,+ "answer_confidence": 0.6362,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 62,+ "output_tokens": 0,+ "state_tokens": 0,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ }+ ]+ },+ {+ "batch_size": 2,+ "sort_by_length": false,+ "states": [+ "We were billed twice for March and want a refund today.",+ "我们三月份被重复扣费了两次,请今天退还。",+ "The reply was polite but arrived nine days late.",+ {+ "order": 1182,+ "items": [+ "widget",+ "case"+ ],+ "charged": 2,+ "currency": "NGN",+ "note": null+ },+ "evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. ",+ "Refund 退款 استرداد वापसी 😀 now!",+ "short one",+ "another short state",+ ""+ ],+ "questions": {+ "intent": {+ "type": "choice",+ "instructions": "What should we do?",+ "criteria": {+ "refund": "send money back",+ "escalate": "pass to a human",+ "ignore": "no action"+ }+ },+ "urgent": {+ "type": "noul",+ "instructions": "This needs a human today."+ }+ },+ "results": [+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9999,+ "escalate": 0.0,+ "ignore": 0.0+ },+ "confidence": 0.9995,+ "answer_confidence": 0.9999,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0283,+ "confidence": 0.9717,+ "answer_confidence": 0.9717,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 86,+ "output_tokens": 0,+ "state_tokens": 12,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9986,+ "escalate": 0.0001,+ "ignore": 0.0013+ },+ "confidence": 0.9899,+ "answer_confidence": 0.9986,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0251,+ "confidence": 0.9749,+ "answer_confidence": 0.9749,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 92,+ "output_tokens": 0,+ "state_tokens": 15,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.02,+ "escalate": 0.0219,+ "ignore": 0.9581+ },+ "confidence": 0.8154,+ "answer_confidence": 0.9581,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0417,+ "confidence": 0.9583,+ "answer_confidence": 0.9583,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 82,+ "output_tokens": 0,+ "state_tokens": 10,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9669,+ "escalate": 0.0055,+ "ignore": 0.0275+ },+ "confidence": 0.8541,+ "answer_confidence": 0.9669,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.2902,+ "confidence": 0.7098,+ "answer_confidence": 0.7098,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 134,+ "output_tokens": 0,+ "state_tokens": 36,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.0165,+ "escalate": 0.0737,+ "ignore": 0.9098+ },+ "confidence": 0.6852,+ "answer_confidence": 0.9098,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.9176,+ "confidence": 0.9176,+ "answer_confidence": 0.9176,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 2048,+ "output_tokens": 0,+ "state_tokens": 1081,+ "state_tokens_dropped": 89,+ "truncated": true,+ "truncated_questions": [+ "intent",+ "urgent"+ ]+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9989,+ "escalate": 0.0002,+ "ignore": 0.0009+ },+ "confidence": 0.9918,+ "answer_confidence": 0.9989,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.7928,+ "confidence": 0.7928,+ "answer_confidence": 0.7928,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 84,+ "output_tokens": 0,+ "state_tokens": 11,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.1705,+ "escalate": 0.1067,+ "ignore": 0.7229+ },+ "confidence": 0.2946,+ "answer_confidence": 0.7229,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.2339,+ "confidence": 0.7661,+ "answer_confidence": 0.7661,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 66,+ "output_tokens": 0,+ "state_tokens": 2,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.0447,+ "escalate": 0.2633,+ "ignore": 0.6921+ },+ "confidence": 0.3219,+ "answer_confidence": 0.6921,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.291,+ "confidence": 0.709,+ "answer_confidence": 0.709,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 68,+ "output_tokens": 0,+ "state_tokens": 3,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.2294,+ "escalate": 0.0721,+ "ignore": 0.6984+ },+ "confidence": 0.2918,+ "answer_confidence": 0.6984,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.6362,+ "confidence": 0.6362,+ "answer_confidence": 0.6362,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 62,+ "output_tokens": 0,+ "state_tokens": 0,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ }+ ]+ },+ {+ "batch_size": 3,+ "sort_by_length": true,+ "states": [+ "We were billed twice for March and want a refund today.",+ "我们三月份被重复扣费了两次,请今天退还。",+ "The reply was polite but arrived nine days late.",+ {+ "order": 1182,+ "items": [+ "widget",+ "case"+ ],+ "charged": 2,+ "currency": "NGN",+ "note": null+ },+ "evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. evidence sentence number one about the duplicate charge. ",+ "Refund 退款 استرداد वापसी 😀 now!",+ "short one",+ "another short state",+ ""+ ],+ "questions": {+ "intent": {+ "type": "choice",+ "instructions": "What should we do?",+ "criteria": {+ "refund": "send money back",+ "escalate": "pass to a human",+ "ignore": "no action"+ }+ },+ "urgent": {+ "type": "noul",+ "instructions": "This needs a human today."+ }+ },+ "results": [+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9999,+ "escalate": 0.0,+ "ignore": 0.0+ },+ "confidence": 0.9995,+ "answer_confidence": 0.9999,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0283,+ "confidence": 0.9717,+ "answer_confidence": 0.9717,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 86,+ "output_tokens": 0,+ "state_tokens": 12,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9986,+ "escalate": 0.0001,+ "ignore": 0.0013+ },+ "confidence": 0.9899,+ "answer_confidence": 0.9986,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0251,+ "confidence": 0.9749,+ "answer_confidence": 0.9749,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 92,+ "output_tokens": 0,+ "state_tokens": 15,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.02,+ "escalate": 0.0219,+ "ignore": 0.9581+ },+ "confidence": 0.8154,+ "answer_confidence": 0.9581,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.0417,+ "confidence": 0.9583,+ "answer_confidence": 0.9583,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 82,+ "output_tokens": 0,+ "state_tokens": 10,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9669,+ "escalate": 0.0055,+ "ignore": 0.0275+ },+ "confidence": 0.8541,+ "answer_confidence": 0.9669,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.2902,+ "confidence": 0.7098,+ "answer_confidence": 0.7098,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 134,+ "output_tokens": 0,+ "state_tokens": 36,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.0165,+ "escalate": 0.0737,+ "ignore": 0.9098+ },+ "confidence": 0.6852,+ "answer_confidence": 0.9098,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.9176,+ "confidence": 0.9176,+ "answer_confidence": 0.9176,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 2048,+ "output_tokens": 0,+ "state_tokens": 1081,+ "state_tokens_dropped": 89,+ "truncated": true,+ "truncated_questions": [+ "intent",+ "urgent"+ ]+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "refund",+ "probabilities": {+ "refund": 0.9989,+ "escalate": 0.0002,+ "ignore": 0.0009+ },+ "confidence": 0.9918,+ "answer_confidence": 0.9989,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.7928,+ "confidence": 0.7928,+ "answer_confidence": 0.7928,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 84,+ "output_tokens": 0,+ "state_tokens": 11,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.1705,+ "escalate": 0.1067,+ "ignore": 0.7229+ },+ "confidence": 0.2946,+ "answer_confidence": 0.7229,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.2339,+ "confidence": 0.7661,+ "answer_confidence": 0.7661,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 66,+ "output_tokens": 0,+ "state_tokens": 2,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.0447,+ "escalate": 0.2633,+ "ignore": 0.6921+ },+ "confidence": 0.3219,+ "answer_confidence": 0.6921,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.291,+ "confidence": 0.709,+ "answer_confidence": 0.709,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 68,+ "output_tokens": 0,+ "state_tokens": 3,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ },+ {+ "model": "laya-rl-agent-onnx",+ "answers": {+ "intent": {+ "type": "choice",+ "choice": "ignore",+ "probabilities": {+ "refund": 0.2294,+ "escalate": 0.0721,+ "ignore": 0.6984+ },+ "confidence": 0.2918,+ "answer_confidence": 0.6984,+ "action": {+ "act_probability": 1.0+ }+ },+ "urgent": {+ "type": "noul",+ "noul": 0.6362,+ "confidence": 0.6362,+ "answer_confidence": 0.6362,+ "action": {+ "act_probability": 1.0+ }+ }+ },+ "usage": {+ "input_tokens": 62,+ "output_tokens": 0,+ "state_tokens": 0,+ "state_tokens_dropped": 0,+ "truncated": false,+ "truncated_questions": []+ }+ }+ ]+ }+ ]+}diff --git a/laya-java/fixtures/python_json.json b/laya-java/fixtures/python_json.jsonnew file mode 100644index 00000000..482ed9aa--- /dev/null+++ b/laya-java/fixtures/python_json.json@@ -0,0 +1,8988 @@+{+ "doubles": [+ {+ "bits": 0,+ "repr": "0.0"+ },+ {+ "bits": 9223372036854775808,+ "repr": "-0.0"+ },+ {+ "bits": 4607182418800017408,+ "repr": "1.0"+ },+ {+ "bits": 13830554455654793216,+ "repr": "-1.0"+ },+ {+ "bits": 4611686018427387904,+ "repr": "2.0"+ },+ {+ "bits": 4602678819172646912,+ "repr": "0.5"+ },+ {+ "bits": 4599676419421066581,+ "repr": "0.3333333333333333"+ },+ {+ "bits": 4604180019048437077,+ "repr": "0.6666666666666666"+ },+ {+ "bits": 4591870180066957722,+ "repr": "0.1"+ },+ {+ "bits": 4596373779694328218,+ "repr": "0.2"+ },+ {+ "bits": 4599075939470750515,+ "repr": "0.3"+ },+ {+ "bits": 4532020583610935537,+ "repr": "1e-05"+ },+ {+ "bits": 4547007122018943789,+ "repr": "0.0001"+ },+ {+ "bits": 4547007122018943789,+ "repr": "0.0001"+ },+ {+ "bits": 4831355200913801216,+ "repr": "1000000000000000.0"+ },+ {+ "bits": 4846369599423283200,+ "repr": "1e+16"+ },+ {+ "bits": 4861130398305394688,+ "repr": "1e+17"+ },+ {+ "bits": 4950912855330343670,+ "repr": "1e+23"+ },+ {+ "bits": 6103021453049119613,+ "repr": "1e+100"+ },+ {+ "bits": 3110860544497550640,+ "repr": "1e-100"+ },+ {+ "bits": 9214871658872686752,+ "repr": "1e+308"+ },+ {+ "bits": 1,+ "repr": "5e-324"+ },+ {+ "bits": 4503599627370496,+ "repr": "2.2250738585072014e-308"+ },+ {+ "bits": 9218868437227405311,+ "repr": "1.7976931348623157e+308"+ },+ {+ "bits": 4845873199050653696,+ "repr": "9007199254740992.0"+ },+ {+ "bits": 4711630319722168320,+ "repr": "10000000.0"+ },+ {+ "bits": 4562254508917369340,+ "repr": "0.001"+ },+ {+ "bits": 4728057454355442549,+ "repr": "123456789.12345679"+ },+ {+ "bits": 4614256656552045848,+ "repr": "3.141592653589793"+ },+ {+ "bits": 4613303445314885481,+ "repr": "2.718281828459045"+ },+ {+ "bits": 9218868437227405312,+ "repr": "Infinity"+ },+ {+ "bits": 18442240474082181120,+ "repr": "-Infinity"+ },+ {+ "bits": 9221120237041090560,+ "repr": "NaN"+ },+ {+ "bits": 3978171147703203451,+ "repr": "9.552619369895552e-43"+ },+ {+ "bits": 6581086088982628796,+ "repr": "9.189545538004333e+131"+ },+ {+ "bits": 10650422945597275269,+ "repr": "-2.7758242530106464e-213"+ },+ {+ "bits": 3529203661043435934,+ "repr": "9.285651537529211e-73"+ },+ {+ "bits": 11419043095426415607,+ "repr": "-6.832372506133289e-162"+ },+ {+ "bits": 13822974118480293016,+ "repr": "-0.32920675672239375"+ },+ {+ "bits": 12390024234947061529,+ "repr": "-5.327917451020063e-97"+ },+ {+ "bits": 6864581533678368491,+ "repr": "8.139577872283829e+150"+ },+ {+ "bits": 186582689102439850,+ "repr": "3.4977031176808683e-296"+ },+ {+ "bits": 4601184982979543616,+ "repr": "0.41707543316991647"+ },+ {+ "bits": 5907251830167303255,+ "repr": "8.322201180444138e+86"+ },+ {+ "bits": 3752656184082131151,+ "repr": "8.010447285923662e-58"+ },+ {+ "bits": 13830386532186354490,+ "repr": "-0.9813567498964411"+ },+ {+ "bits": 1791425515728708593,+ "repr": "6.379055234597682e-189"+ },+ {+ "bits": 4589196621460050192,+ "repr": "0.06289692096158128"+ },+ {+ "bits": 2227559052053892927,+ "repr": "9.203826790060181e-160"+ },+ {+ "bits": 1286074467794944226,+ "repr": "1.0829949247014235e-222"+ },+ {+ "bits": 5068017669956734539,+ "repr": "6.723523854940374e+30"+ },+ {+ "bits": 10848677159721951329,+ "repr": "-4.938879384034178e-200"+ },+ {+ "bits": 4607049321643000700,+ "repr": "0.9852232471767901"+ },+ {+ "bits": 13824987804239589988,+ "repr": "-0.4409887714389582"+ },+ {+ "bits": 11679180497037756194,+ "repr": "-1.6644765482445654e-144"+ },+ {+ "bits": 4603339361585542250,+ "repr": "0.5733349395537861"+ },+ {+ "bits": 13827162498331980228,+ "repr": "-0.6234170881667116"+ },+ {+ "bits": 1611401670033469118,+ "repr": "5.888843097592786e-201"+ },+ {+ "bits": 13819653314901653768,+ "repr": "-0.19743256352962413"+ },+ {+ "bits": 10729073566708521629,+ "repr": "-5.18956539864995e-208"+ },+ {+ "bits": 6796910108896976228,+ "repr": "2.431906735358137e+146"+ },+ {+ "bits": 4607017062503831476,+ "repr": "0.9816417632707641"+ },+ {+ "bits": 13816141834601168624,+ "repr": "-0.11248470326335869"+ },+ {+ "bits": 7841065068668170454,+ "repr": "1.4701907179335867e+216"+ },+ {+ "bits": 4603553680259432984,+ "repr": "0.5971290921898484"+ },+ {+ "bits": 13827646736987325672,+ "repr": "-0.6771783786245154"+ },+ {+ "bits": 1299795674766284323,+ "repr": "8.922456598586451e-222"+ },+ {+ "bits": 3557786935660233189,+ "repr": "7.198882848825769e-71"+ },+ {+ "bits": 16565756358423785067,+ "repr": "-7.100390202440841e+182"+ },+ {+ "bits": 14096213843922995438,+ "repr": "-5.730694085173728e+17"+ },+ {+ "bits": 10577425247117513488,+ "repr": "-3.762497255687759e-218"+ },+ {+ "bits": 13477304204564890754,+ "repr": "-2.5852497013797546e-24"+ },+ {+ "bits": 4600826489452346420,+ "repr": "0.3971750447662459"+ },+ {+ "bits": 6651619334850814709,+ "repr": "4.549864624543534e+136"+ },+ {+ "bits": 8883333352179729589,+ "repr": "7.119811272142023e+285"+ },+ {+ "bits": 12264078511957361733,+ "repr": "-2.044854876238242e-105"+ },+ {+ "bits": 4412292577587841808,+ "repr": "9.809822382410313e-14"+ },+ {+ "bits": 4599828497013982876,+ "repr": "0.34177533559259543"+ },+ {+ "bits": 184948606001826925,+ "repr": "2.6100186475143126e-296"+ },+ {+ "bits": 12405001631910750009,+ "repr": "-5.482005002376173e-96"+ },+ {+ "bits": 4600741575512381872,+ "repr": "0.3924613742032319"+ },+ {+ "bits": 16712547342400402419,+ "repr": "-4.404972391994052e+192"+ },+ {+ "bits": 12980618976870786996,+ "repr": "-1.626753817854928e-57"+ },+ {+ "bits": 5093544152204674223,+ "repr": "3.2354482673123107e+32"+ },+ {+ "bits": 2173342708718934095,+ "repr": "2.193617165587196e-163"+ },+ {+ "bits": 17658608895780660160,+ "repr": "-7.503146662943445e+255"+ },+ {+ "bits": 726724380737544622,+ "repr": "4.4396519820323155e-260"+ },+ {+ "bits": 16923040336771669414,+ "repr": "-5.3609649399711594e+206"+ },+ {+ "bits": 13828503347808443564,+ "repr": "-0.7722812842993299"+ },+ {+ "bits": 17096968617529350151,+ "repr": "-2.276229548696217e+218"+ },+ {+ "bits": 9983161554799599889,+ "repr": "-7.106058572558057e-258"+ },+ {+ "bits": 5315924049694795810,+ "repr": "2.506941939833949e+47"+ },+ {+ "bits": 17289855560630864342,+ "repr": "-1.7374962311357494e+231"+ },+ {+ "bits": 1368655563567532722,+ "repr": "3.4494268312137375e-217"+ },+ {+ "bits": 4599265097014908340,+ "repr": "0.31050035304027834"+ },+ {+ "bits": 10916237013506949455,+ "repr": "-1.6194859172936148e-195"+ },+ {+ "bits": 5959263911474122046,+ "repr": "2.490074544127754e+90"+ },+ {+ "bits": 11802841599565899803,+ "repr": "-3.022162808602813e-136"+ },+ {+ "bits": 4614749725933261931,+ "repr": "3.3605594454953027"+ },+ {+ "bits": 11029723012365496128,+ "repr": "-6.265617400803806e-188"+ },+ {+ "bits": 3438631145007832719,+ "repr": "8.255605403651307e-79"+ },+ {+ "bits": 4605305698443830064,+ "repr": "0.7916421849778086"+ },+ {+ "bits": 9014872689643610680,+ "repr": "4.352770784873027e+294"+ },+ {+ "bits": 4607048283702969664,+ "repr": "0.9851080126847265"+ },+ {+ "bits": 5230984332347567253,+ "repr": "5.2680264460471265e+41"+ },+ {+ "bits": 7549016505611123413,+ "repr": "4.553786078117877e+196"+ },+ {+ "bits": 4600106200907141124,+ "repr": "0.357190998403212"+ },+ {+ "bits": 7567830788261016397,+ "repr": "8.348179867048262e+197"+ },+ {+ "bits": 10854520220522485759,+ "repr": "-1.2412601361963984e-199"+ },+ {+ "bits": 15536259489067297891,+ "repr": "-1.0728429117095472e+114"+ },+ {+ "bits": 2344073982388230716,+ "repr": "5.685929028939189e-152"+ },+ {+ "bits": 15065369687913994470,+ "repr": "-3.594120797294844e+82"+ },+ {+ "bits": 13829296122554629606,+ "repr": "-0.8602969619550407"+ },+ {+ "bits": 4598187097160613468,+ "repr": "0.2506593401012418"+ },+ {+ "bits": 5297857945317686039,+ "repr": "1.553729717569481e+46"+ },+ {+ "bits": 4603197949764356164,+ "repr": "0.5576350735702893"+ },+ {+ "bits": 12692821050064617946,+ "repr": "-9.482067072173232e-77"+ },+ {+ "bits": 5009939596914402663,+ "repr": "8.851633348202797e+26"+ },+ {+ "bits": 2452962526729094975,+ "repr": "1.0680521615360056e-144"+ },+ {+ "bits": 4595210325439697848,+ "repr": "0.1677076574602816"+ },+ {+ "bits": 13824524303996118964,+ "repr": "-0.41525933932791337"+ },+ {+ "bits": 13827242920487391954,+ "repr": "-0.6323457410295197"+ },+ {+ "bits": 13826301065315247088,+ "repr": "-0.5277788112317676"+ },+ {+ "bits": 5121599192299602184,+ "repr": "2.541046193482146e+34"+ },+ {+ "bits": 10278689441861690725,+ "repr": "-4.077367106264768e-238"+ },+ {+ "bits": 2799386301472656060,+ "repr": "1.538024414795845e-121"+ },+ {+ "bits": 8237789947258215858,+ "repr": "4.936738822946834e+242"+ },+ {+ "bits": 17352220262890324964,+ "repr": "-2.5015392079206468e+235"+ },+ {+ "bits": 11491644572003179016,+ "repr": "-4.8295055772841025e-157"+ },+ {+ "bits": 4606184232801976130,+ "repr": "0.8891790922116132"+ },+ {+ "bits": 4601161572284349096,+ "repr": "0.4157758785285446"+ },+ {+ "bits": 12703037478187832600,+ "repr": "-4.53485402090347e-76"+ },+ {+ "bits": 15903551094882089463,+ "repr": "-3.863482289233909e+138"+ },+ {+ "bits": 14370746720025116042,+ "repr": "-1.2938558601859312e+36"+ },+ {+ "bits": 17463896320622305919,+ "repr": "-7.527746453042503e+242"+ },+ {+ "bits": 1634539561152254942,+ "repr": "2.0282863976700038e-199"+ },+ {+ "bits": 10145665947058767496,+ "repr": "-5.1213027068654556e-247"+ },+ {+ "bits": 13361815556393828988,+ "repr": "-4.730839032704573e-32"+ },+ {+ "bits": 13829142824182202639,+ "repr": "-0.8432774236844426"+ },+ {+ "bits": 305158538695984495,+ "repr": "2.8876354928201442e-288"+ },+ {+ "bits": 17296741562990780007,+ "repr": "-5.117555590194389e+231"+ },+ {+ "bits": 12543186045335628252,+ "repr": "-9.223698824082133e-87"+ },+ {+ "bits": 10014883972889615318,+ "repr": "-9.329077351299747e-256"+ },+ {+ "bits": 13819514230573734336,+ "repr": "-0.1935721979491074"+ },+ {+ "bits": 139145374452657202,+ "repr": "2.2654918462636795e-299"+ },+ {+ "bits": 4605991547890218800,+ "repr": "0.8677867696585277"+ },+ {+ "bits": 362760863575496898,+ "repr": "2.0834902764759428e-284"+ },+ {+ "bits": 14498067280152986401,+ "repr": "-4.344618327544333e+44"+ },+ {+ "bits": 13830139595732562078,+ "repr": "-0.9539412962344789"+ },+ {+ "bits": 4500976984360076896,+ "repr": "8.4498898320919e-08"+ },+ {+ "bits": 11358413460940294488,+ "repr": "-5.830560530441581e-166"+ },+ {+ "bits": 17476408612596995852,+ "repr": "-5.2652635496121304e+243"+ },+ {+ "bits": 16566470765794517761,+ "repr": "-7.942936006553572e+182"+ },+ {+ "bits": 6330191617376368376,+ "repr": "1.5612028187346027e+115"+ },+ {+ "bits": 13827887493678889422,+ "repr": "-0.7039077408551806"+ },+ {+ "bits": 13824244163514609624,+ "repr": "-0.399708418692851"+ },+ {+ "bits": 17149009017238756100,+ "repr": "-6.668945882900281e+221"+ },+ {+ "bits": 16610254864170414599,+ "repr": "-6.62168947037776e+185"+ },+ {+ "bits": 8777712008783458371,+ "repr": "5.919813586714822e+278"+ },+ {+ "bits": 10893696802932378708,+ "repr": "-5.047697279663467e-197"+ },+ {+ "bits": 15266576620203430555,+ "repr": "-9.937541864279668e+95"+ },+ {+ "bits": 290693474727924063,+ "repr": "3.1746904172341663e-289"+ },+ {+ "bits": 7681692808525508416,+ "repr": "3.367938186692857e+205"+ },+ {+ "bits": 4366120861597458616,+ "repr": "8.18002203942235e-17"+ },+ {+ "bits": 13827351931067602184,+ "repr": "-0.6444483466372342"+ },+ {+ "bits": 7627838222919117725,+ "repr": "8.427669668437561e+201"+ },+ {+ "bits": 9645919083493752003,+ "repr": "-2.0100108143616026e-280"+ },+ {+ "bits": 7632460846432004610,+ "repr": "1.7114280705811273e+202"+ },+ {+ "bits": 10219749938648150606,+ "repr": "-4.6503257162487135e-242"+ },+ {+ "bits": 13320664548674916968,+ "repr": "-8.57855924812809e-35"+ },+ {+ "bits": 11210952768461916499,+ "repr": "-8.41219312798119e-176"+ },+ {+ "bits": 12786200322245925903,+ "repr": "-1.603650713589755e-70"+ },+ {+ "bits": 15719341438246209960,+ "repr": "-1.888555409364279e+126"+ },+ {+ "bits": 13827122982815030474,+ "repr": "-0.6190299844919533"+ },+ {+ "bits": 4600484409602524208,+ "repr": "0.3781857984895991"+ },+ {+ "bits": 4601582810291274568,+ "repr": "0.4391592852353381"+ },+ {+ "bits": 3344142331071798845,+ "repr": "3.986172636285942e-85"+ },+ {+ "bits": 4606410992594779308,+ "repr": "0.914354486514545"+ },+ {+ "bits": 17011523642478787989,+ "repr": "-4.433819442706567e+212"+ },+ {+ "bits": 14437885068519643114,+ "repr": "-4.038712850774665e+40"+ },+ {+ "bits": 11090841832147626662,+ "repr": "-7.82090966802378e-184"+ },+ {+ "bits": 13829217855709363030,+ "repr": "-0.851607596587068"+ },+ {+ "bits": 637430428893262053,+ "repr": "4.769761908172684e-266"+ },+ {+ "bits": 7081163702197985352,+ "repr": "2.458597694017446e+165"+ },+ {+ "bits": 15310049537869569397,+ "repr": "-8.278202752133502e+98"+ },+ {+ "bits": 4584716054656591712,+ "repr": "0.0316082828022235"+ },+ {+ "bits": 4602801099219951742,+ "repr": "0.5135758123970076"+ },+ {+ "bits": 4593377428473112624,+ "repr": "0.12091727355428428"+ },+ {+ "bits": 14310457242326907637,+ "repr": "-1.2654801138868698e+32"+ },+ {+ "bits": 4602432733394089976,+ "repr": "0.4863394951306641"+ },+ {+ "bits": 488804484832673716,+ "repr": "5.546996657778667e-276"+ },+ {+ "bits": 2920379372961771099,+ "repr": "1.889994777798372e-113"+ },+ {+ "bits": 14194702577333991474,+ "repr": "-2.2451273449433653e+24"+ },+ {+ "bits": 13830403447755215324,+ "repr": "-0.9832347552988341"+ },+ {+ "bits": 13829062637225249044,+ "repr": "-0.8343748830959918"+ },+ {+ "bits": 16516354269751110088,+ "repr": "-3.546172448873206e+179"+ },+ {+ "bits": 12990334749084410476,+ "repr": "-7.309091436366523e-57"+ },+ {+ "bits": 10742227950762077300,+ "repr": "-3.905151160568212e-207"+ },+ {+ "bits": 18157259120663649969,+ "repr": "-1.6775856107680612e+289"+ },+ {+ "bits": 4590462779306674896,+ "repr": "0.0804683908882382"+ },+ {+ "bits": 15130142963282129955,+ "repr": "-7.79114907958787e+86"+ },+ {+ "bits": 11450439177414340107,+ "repr": "-8.582300519686127e-160"+ },+ {+ "bits": 1812478216018483,+ "repr": "8.95483220370362e-309"+ },+ {+ "bits": 9223372225831178680,+ "repr": "-9.33667485337e-313"+ },+ {+ "bits": 369319842119904199,+ "repr": "5.409371897557478e-284"+ },+ {+ "bits": 4595020795056509288,+ "repr": "0.1624471325782324"+ },+ {+ "bits": 13828168780364368330,+ "repr": "-0.7351368363290984"+ },+ {+ "bits": 6501412846164023086,+ "repr": "4.3421710029868e+126"+ },+ {+ "bits": 13819102381388895440,+ "repr": "-0.1821410867570763"+ },+ {+ "bits": 16907097258173352714,+ "repr": "-4.533797626012144e+205"+ },+ {+ "bits": 4590002915267804288,+ "repr": "0.07408649533634737"+ },+ {+ "bits": 11480058141817959933,+ "repr": "-7.902451536621915e-158"+ },+ {+ "bits": 13786447588192223232,+ "repr": "-0.001178035195110283"+ },+ {+ "bits": 8763692528498034918,+ "repr": "6.844763801553188e+277"+ },+ {+ "bits": 7834956685557230387,+ "repr": "5.894377111635596e+215"+ },+ {+ "bits": 13822097818039236172,+ "repr": "-0.28056231041486934"+ },+ {+ "bits": 15510659211381811804,+ "repr": "-2.0358922676992274e+112"+ },+ {+ "bits": 4603224382764848456,+ "repr": "0.5605697261459364"+ },+ {+ "bits": 2277777996860524102,+ "repr": "2.0607342064507503e-156"+ },+ {+ "bits": 13826737009985077874,+ "repr": "-0.5761783922226427"+ },+ {+ "bits": 18164489803200189859,+ "repr": "-5.1726646121963356e+289"+ },+ {+ "bits": 13818817610998143368,+ "repr": "-0.17423712064346497"+ },+ {+ "bits": 13819024010613667152,+ "repr": "-0.1799658607791721"+ },+ {+ "bits": 6982476620000315781,+ "repr": "6.244274809573489e+158"+ },+ {+ "bits": 3400146910320222875,+ "repr": "2.0918645010377015e-81"+ },+ {+ "bits": 4603001837300576764,+ "repr": "0.5358622162999036"+ },+ {+ "bits": 4187114619711432716,+ "repr": "8.715140954263561e-29"+ },+ {+ "bits": 9745230243126278670,+ "repr": "-8.668626522843784e-274"+ },+ {+ "bits": 3181393676001663001,+ "repr": "5.2858069830891045e-96"+ },+ {+ "bits": 13828059216151569832,+ "repr": "-0.7229727651567162"+ },+ {+ "bits": 13825078082454650092,+ "repr": "-0.44600021908804766"+ },+ {+ "bits": 4600490536535119208,+ "repr": "0.37852591157146387"+ },+ {+ "bits": 17015070495364672413,+ "repr": "-7.43728285379939e+212"+ },+ {+ "bits": 1787465105364943,+ "repr": "8.831251017008224e-309"+ },+ {+ "bits": 4604933134344020018,+ "repr": "0.7502792608020228"+ },+ {+ "bits": 4606422396472670124,+ "repr": "0.9156205712949848"+ },+ {+ "bits": 7015457800923483654,+ "repr": "9.810757547844604e+160"+ },+ {+ "bits": 6657965735652062468,+ "repr": "1.2702781312456746e+137"+ },+ {+ "bits": 5435411405945442317,+ "repr": "2.3340253286279462e+55"+ },+ {+ "bits": 13815388701667074456,+ "repr": "-0.10203288421292311"+ },+ {+ "bits": 4600461016797006752,+ "repr": "0.3768872369247962"+ },+ {+ "bits": 4701506624052336737,+ "repr": "2038621.4210372197"+ },+ {+ "bits": 13820357620657251432,+ "repr": "-0.21698097518563775"+ },+ {+ "bits": 14562847678321940908,+ "repr": "-9.363895454142518e+48"+ },+ {+ "bits": 9236120043634508177,+ "repr": "-8.146556688619722e-308"+ },+ {+ "bits": 4739945081534063349,+ "repr": "794157167.395598"+ },+ {+ "bits": 3685278520671860147,+ "repr": "2.520735720641799e-62"+ },+ {+ "bits": 12673867707677920785,+ "repr": "-5.02602565996797e-78"+ },+ {+ "bits": 17254301151148106206,+ "repr": "-7.425902437947525e+228"+ },+ {+ "bits": 4602923891375943036,+ "repr": "0.5272084802794974"+ },+ {+ "bits": 6557757574684834921,+ "repr": "2.4725334456802203e+130"+ },+ {+ "bits": 13821847958228274280,+ "repr": "-0.26669230466195026"+ },+ {+ "bits": 5338891310292232943,+ "repr": "8.605390223156467e+48"+ },+ {+ "bits": 16963320625196635299,+ "repr": "-2.6527957461285542e+209"+ },+ {+ "bits": 14238917262141820608,+ "repr": "-2.0732500245329505e+27"+ },+ {+ "bits": 3752643393587803792,+ "repr": "7.992349377816144e-58"+ },+ {+ "bits": 2424411190848779488,+ "repr": "1.328807624203464e-146"+ },+ {+ "bits": 13819413393215393320,+ "repr": "-0.19077339902479307"+ },+ {+ "bits": 11774447079905621389,+ "repr": "-3.902951844593344e-138"+ },+ {+ "bits": 3185371042547414632,+ "repr": "9.696348603671624e-96"+ },+ {+ "bits": 4587283393539471232,+ "repr": "0.04942277492590019"+ },+ {+ "bits": 14782875315563947480,+ "repr": "-4.797333935894652e+63"+ },+ {+ "bits": 16206938781380526255,+ "repr": "-7.307741889867107e+158"+ },+ {+ "bits": 11310621751305961749,+ "repr": "-3.875338597911854e-169"+ },+ {+ "bits": 12930366310727198405,+ "repr": "-6.957822707290285e-61"+ },+ {+ "bits": 3184746457987279500,+ "repr": "8.65749861392766e-96"+ },+ {+ "bits": 4600031761915193712,+ "repr": "0.35305880426371683"+ },+ {+ "bits": 4945533759005272055,+ "repr": "4.265580139769081e+22"+ },+ {+ "bits": 13828129137492577440,+ "repr": "-0.7307355934266475"+ },+ {+ "bits": 7941409477088432511,+ "repr": "7.791234268992215e+222"+ },+ {+ "bits": 3072069278694253967,+ "repr": "2.5369169722585014e-103"+ },+ {+ "bits": 4581926652281725184,+ "repr": "0.0217514578338589"+ },+ {+ "bits": 4599491578328372492,+ "repr": "0.3230725914830408"+ },+ {+ "bits": 13828730122715444036,+ "repr": "-0.7974583566152451"+ },+ {+ "bits": 2416496788984831848,+ "repr": "3.9292753009587567e-147"+ },+ {+ "bits": 2002124895412733916,+ "repr": "7.88940321929996e-175"+ },+ {+ "bits": 1165326611321922787,+ "repr": "9.040729526066137e-231"+ },+ {+ "bits": 5682955943675604565,+ "repr": "8.258717224993961e+71"+ },+ {+ "bits": 13181950088697293382,+ "repr": "-4.441330477159208e-44"+ },+ {+ "bits": 7052123361913484504,+ "repr": "2.7151063934043496e+163"+ },+ {+ "bits": 4236574083312091704,+ "repr": "1.7664633935156084e-25"+ },+ {+ "bits": 4594801015084423928,+ "repr": "0.15634701294421638"+ },+ {+ "bits": 13258466574377999510,+ "repr": "-5.79216736186058e-39"+ },+ {+ "bits": 7884024430407353131,+ "repr": "1.1331990488268622e+219"+ },+ {+ "bits": 6134320586189861249,+ "repr": "1.2237864975649055e+102"+ },+ {+ "bits": 4606713875714146118,+ "repr": "0.9479812678036772"+ },+ {+ "bits": 13823760245317157496,+ "repr": "-0.37284556245052825"+ },+ {+ "bits": 13828310814901184318,+ "repr": "-0.7509058376356064"+ },+ {+ "bits": 14501631299094722769,+ "repr": "-7.200411629954973e+44"+ },+ {+ "bits": 13822733871473659964,+ "repr": "-0.3158703688043294"+ },+ {+ "bits": 8106785965860006237,+ "repr": "8.490108894581554e+233"+ },+ {+ "bits": 17399264470694634544,+ "repr": "-3.679924482364478e+238"+ },+ {+ "bits": 6109502781718009705,+ "repr": "2.7684145372423053e+100"+ },+ {+ "bits": 13505296717966206404,+ "repr": "-1.882820978188535e-22"+ },+ {+ "bits": 13826241633610582290,+ "repr": "-0.5211805665406095"+ },+ {+ "bits": 13826349987785365860,+ "repr": "-0.5332102965065073"+ },+ {+ "bits": 5784760744899682871,+ "repr": "5.4650686453676686e+78"+ },+ {+ "bits": 11319542095123226538,+ "repr": "-1.5296945559453956e-168"+ },+ {+ "bits": 10490971720100006894,+ "repr": "-6.326837013658015e-224"+ },+ {+ "bits": 4581480072615045696,+ "repr": "0.02020207337049329"+ },+ {+ "bits": 14106089904301424805,+ "repr": "-2.7235691542537364e+18"+ },+ {+ "bits": 13949450958297351386,+ "repr": "-93974351.26149312"+ },+ {+ "bits": 16383610490057127312,+ "repr": "-4.5705849304272503e+170"+ },+ {+ "bits": 5139602318976852964,+ "repr": "4.057356765395001e+35"+ },+ {+ "bits": 17113779904615905656,+ "repr": "-2.887547761672573e+219"+ },+ {+ "bits": 4605217164939691946,+ "repr": "0.7818129915033201"+ },+ {+ "bits": 4606319732925864708,+ "repr": "0.9042226279496792"+ },+ {+ "bits": 6730593675595844769,+ "repr": "9.097053358748197e+141"+ },+ {+ "bits": 8421321429133258264,+ "repr": "8.957357586288577e+254"+ },+ {+ "bits": 2520748525614795530,+ "repr": "3.607941349594972e-140"+ },+ {+ "bits": 5506081216246406281,+ "repr": "1.2820379473000253e+60"+ },+ {+ "bits": 13813482594524625056,+ "repr": "-0.07558033375105078"+ },+ {+ "bits": 7883886480277295253,+ "repr": "1.1115733979518687e+219"+ },+ {+ "bits": 18408010706764289701,+ "repr": "-9.827376304501852e+305"+ },+ {+ "bits": 13827755628577474850,+ "repr": "-0.6892677736816817"+ },+ {+ "bits": 4600614607975992748,+ "repr": "0.385413260089275"+ },+ {+ "bits": 1052479144187756463,+ "repr": "2.606550058960996e-238"+ },+ {+ "bits": 15126176511649115420,+ "repr": "-4.1921552764125055e+86"+ },+ {+ "bits": 13825223456303367728,+ "repr": "-0.45407008878928234"+ },+ {+ "bits": 16793132735638817393,+ "repr": "-1.0910801870837151e+198"+ },+ {+ "bits": 2144391785574612512,+ "repr": "2.4976229092806324e-165"+ },+ {+ "bits": 1180587648650575377,+ "repr": "9.424631364760318e-230"+ },+ {+ "bits": 4738024092669193114,+ "repr": "565157449.5794556"+ },+ {+ "bits": 13509880592732992560,+ "repr": "-3.803387145534902e-22"+ },+ {+ "bits": 13514630193017343573,+ "repr": "-7.838112197133139e-22"+ },+ {+ "bits": 13823669660578481668,+ "repr": "-0.3678170993226504"+ },+ {+ "bits": 3615789039069959753,+ "repr": "5.5384343169253566e-67"+ },+ {+ "bits": 9646594111671373016,+ "repr": "-2.1751560921573242e-280"+ },+ {+ "bits": 10751119901885931138,+ "repr": "-1.5301776181889548e-206"+ },+ {+ "bits": 15564725075985348701,+ "repr": "-8.3786810892343e+115"+ },+ {+ "bits": 17359068246842942517,+ "repr": "-7.567095170461398e+235"+ },+ {+ "bits": 13815715593205253232,+ "repr": "-0.10656941561593825"+ },+ {+ "bits": 15851886586074122207,+ "repr": "-1.3271306991426887e+135"+ },+ {+ "bits": 15975622746136745837,+ "repr": "-2.5380617560108704e+143"+ },+ {+ "bits": 13793625964138552832,+ "repr": "-0.0035160697085918624"+ },+ {+ "bits": 13813263816837869296,+ "repr": "-0.07254418343716984"+ },+ {+ "bits": 4605141812003422466,+ "repr": "0.7734471350213712"+ },+ {+ "bits": 13824439045054755128,+ "repr": "-0.4105265173400485"+ },+ {+ "bits": 8501187347156664696,+ "repr": "2.0206784902587124e+260"+ },+ {+ "bits": 18241668914701437516,+ "repr": "-7.480945134834604e+294"+ },+ {+ "bits": 4164892526116252280,+ "repr": "2.8271441931653063e-30"+ },+ {+ "bits": 14117861727946379008,+ "repr": "-1.6556227368171602e+19"+ },+ {+ "bits": 5758494747665046017,+ "repr": "9.510532348190326e+76"+ },+ {+ "bits": 4600385228933948428,+ "repr": "0.3726801653970717"+ },+ {+ "bits": 2220954541695187197,+ "repr": "3.274671374575007e-160"+ },+ {+ "bits": 11805694041507346336,+ "repr": "-4.783280203055383e-136"+ },+ {+ "bits": 14730912303925089673,+ "repr": "-1.542341312545379e+60"+ },+ {+ "bits": 16776578163674689137,+ "repr": "-8.586428821758654e+196"+ },+ {+ "bits": 12198610783766640772,+ "repr": "-8.705995623029913e-110"+ },+ {+ "bits": 13819853833506759032,+ "repr": "-0.20299807283596372"+ },+ {+ "bits": 12737882095016849923,+ "repr": "-9.748985899208213e-74"+ },+ {+ "bits": 13826286596623810726,+ "repr": "-0.526172463794883"+ },+ {+ "bits": 5769384493345764046,+ "repr": "4.91282901113084e+77"+ },+ {+ "bits": 4606504485533634374,+ "repr": "0.9247342878502216"+ },+ {+ "bits": 11262067483070994142,+ "repr": "-2.1753248707337047e-172"+ },+ {+ "bits": 1456867715970683690,+ "repr": "2.8318972144896506e-211"+ },+ {+ "bits": 17378389031893040380,+ "repr": "-1.4468474721485617e+237"+ },+ {+ "bits": 7865960709777532166,+ "repr": "7.034169392732916e+217"+ },+ {+ "bits": 453137095381466281,+ "repr": "2.279970821376892e-278"+ },+ {+ "bits": 13822703557416559104,+ "repr": "-0.31418760059617057"+ },+ {+ "bits": 5684560666463928062,+ "repr": "1.0831014188408494e+72"+ },+ {+ "bits": 13826377321724462856,+ "repr": "-0.536244973360426"+ },+ {+ "bits": 1431617486524762277,+ "repr": "5.59318723650666e-213"+ },+ {+ "bits": 15327639103169832238,+ "repr": "-1.2419814143479149e+100"+ },+ {+ "bits": 4605204766057773538,+ "repr": "0.7804364390847776"+ },+ {+ "bits": 5667619433311927095,+ "repr": "8.085080767716433e+70"+ },+ {+ "bits": 11756819880361731313,+ "repr": "-2.583737993678476e-139"+ },+ {+ "bits": 5397542354997673847,+ "repr": "7.160392806736814e+52"+ },+ {+ "bits": 9858319938095213603,+ "repr": "-3.0807633243997755e-266"+ },+ {+ "bits": 8315480524037129893,+ "repr": "7.873392483634579e+247"+ },+ {+ "bits": 4605647627281471628,+ "repr": "0.8296039118111067"+ },+ {+ "bits": 13828801757925201904,+ "repr": "-0.8054114625399489"+ },+ {+ "bits": 13826199100548385504,+ "repr": "-0.516458448044741"+ },+ {+ "bits": 2048276621223372014,+ "repr": "9.360877600222794e-172"+ },+ {+ "bits": 1730630890292063385,+ "repr": "5.598987090475623e-193"+ },+ {+ "bits": 11969703062849289182,+ "repr": "-4.273436520663199e-125"+ },+ {+ "bits": 5604536314868064949,+ "repr": "4.910254929482415e+66"+ },+ {+ "bits": 3335066491753441301,+ "repr": "9.86736318165169e-86"+ },+ {+ "bits": 13827923673017932460,+ "repr": "-0.7079244543773107"+ },+ {+ "bits": 4585500864796090368,+ "repr": "0.0370539970949153"+ },+ {+ "bits": 9223901349202230713,+ "repr": "-2.61515046797054e-309"+ },+ {+ "bits": 4590093484707297856,+ "repr": "0.0753433987995118"+ },+ {+ "bits": 12642496705908301523,+ "repr": "-4.042085586432971e-80"+ },+ {+ "bits": 16330955357160544462,+ "repr": "-1.4158613598884314e+167"+ },+ {+ "bits": 4600853336937862012,+ "repr": "0.3986653795948809"+ },+ {+ "bits": 4601920972409641096,+ "repr": "0.45793105372866494"+ },+ {+ "bits": 15813629788464115811,+ "repr": "-3.779501204024939e+132"+ },+ {+ "bits": 361089613030256600,+ "repr": "1.5843807304674826e-284"+ },+ {+ "bits": 576479108240219969,+ "repr": "3.801197163921268e-270"+ },+ {+ "bits": 16209803320312667166,+ "repr": "-1.1417524186476165e+159"+ },+ {+ "bits": 17735929047143903542,+ "repr": "-1.1487099903072978e+261"+ },+ {+ "bits": 13827230700453905666,+ "repr": "-0.630989044775703"+ },+ {+ "bits": 862075173576814801,+ "repr": "4.9552920620895106e-251"+ },+ {+ "bits": 91678458,+ "repr": "4.52951766e-316"+ },+ {+ "bits": 385589159812792292,+ "repr": "6.963708971029863e-283"+ },+ {+ "bits": 10013999885886862316,+ "repr": "-8.283156289931177e-256"+ },+ {+ "bits": 13823819856852480384,+ "repr": "-0.37615466740296455"+ },+ {+ "bits": 8121974005889473694,+ "repr": "9.160363321791764e+234"+ },+ {+ "bits": 648709963162563280,+ "repr": "2.586602272475861e-265"+ },+ {+ "bits": 13812579883415276640,+ "repr": "-0.06305270052375667"+ },+ {+ "bits": 13827256898738399516,+ "repr": "-0.6338976386407782"+ },+ {+ "bits": 2747833469267544048,+ "repr": "5.396654827593173e-125"+ },+ {+ "bits": 12435100929340586282,+ "repr": "-5.499110209783674e-94"+ },+ {+ "bits": 1853542967169021657,+ "repr": "9.232628089581522e-185"+ },+ {+ "bits": 13829438410033386916,+ "repr": "-0.8760940454582635"+ },+ {+ "bits": 4940515907836647371,+ "repr": "1.91709734023568e+22"+ },+ {+ "bits": 13829304042278439034,+ "repr": "-0.8611762279272306"+ },+ {+ "bits": 13812663043692253824,+ "repr": "-0.0642067812016851"+ },+ {+ "bits": 4600152456070243696,+ "repr": "0.3597586757574254"+ },+ {+ "bits": 9759551275685499290,+ "repr": "-7.805979851146007e-273"+ },+ {+ "bits": 13817410411434324400,+ "repr": "-0.13517948674360758"+ },+ {+ "bits": 14606110443297549708,+ "repr": "-7.231600260610495e+51"+ },+ {+ "bits": 730692463213516111,+ "repr": "8.105933924156918e-260"+ },+ {+ "bits": 13828026411168621822,+ "repr": "-0.7193306804175845"+ },+ {+ "bits": 13822784035569203756,+ "repr": "-0.3186550354984401"+ },+ {+ "bits": 4601851066187223712,+ "repr": "0.4540504788440476"+ },+ {+ "bits": 8944516373528680461,+ "repr": "8.432459655335343e+289"+ },+ {+ "bits": 2047048394103239936,+ "repr": "7.94947349805738e-172"+ },+ {+ "bits": 4948908131708065902,+ "repr": "7.0962091247328895e+22"+ },+ {+ "bits": 15807992716024520282,+ "repr": "-1.532461779846586e+132"+ },+ {+ "bits": 4139888180707637988,+ "repr": "6.11286106169e-32"+ },+ {+ "bits": 7213515398229280636,+ "repr": "1.7037866387066314e+174"+ },+ {+ "bits": 4605129436827397796,+ "repr": "0.7720732144857334"+ },+ {+ "bits": 13809463426450845024,+ "repr": "-0.04115158602959457"+ },+ {+ "bits": 13818253690729525240,+ "repr": "-0.15858518898664875"+ },+ {+ "bits": 7828735478302585269,+ "repr": "2.2898167324183133e+215"+ },+ {+ "bits": 17913947942262341566,+ "repr": "-9.172172153590157e+272"+ },+ {+ "bits": 13812694187741864240,+ "repr": "-0.0646389917136545"+ },+ {+ "bits": 16456190999601934218,+ "repr": "-3.192514157916109e+175"+ },+ {+ "bits": 4604026113716869478,+ "repr": "0.6495797423947749"+ },+ {+ "bits": 13829868924045493094,+ "repr": "-0.9238907023246667"+ },+ {+ "bits": 4605024778530485374,+ "repr": "0.7604538093907107"+ },+ {+ "bits": 7076049765224519253,+ "repr": "1.1044318134863727e+165"+ },+ {+ "bits": 10960860208465474687,+ "repr": "-1.5779928139870635e-192"+ },+ {+ "bits": 8401449572487758422,+ "repr": "4.3888213762509474e+253"+ },+ {+ "bits": 4604852312154803470,+ "repr": "0.7413061952651405"+ },+ {+ "bits": 13829144834204760496,+ "repr": "-0.8435005810168175"+ },+ {+ "bits": 4561860965838846137,+ "repr": "0.000945613223929851"+ },+ {+ "bits": 4600618446820240312,+ "repr": "0.3856263587528548"+ },+ {+ "bits": 13808150044368869984,+ "repr": "-0.03203816710747698"+ },+ {+ "bits": 13823842025548373596,+ "repr": "-0.3773852772332924"+ },+ {+ "bits": 7570160196652382531,+ "repr": "1.1441273110650119e+198"+ },+ {+ "bits": 4602802601478359272,+ "repr": "0.5137425965843052"+ },+ {+ "bits": 11823740221584947278,+ "repr": "-7.69208459214287e-135"+ },+ {+ "bits": 5432215749527721853,+ "repr": "1.4640849048775408e+55"+ },+ {+ "bits": 17230368900482984123,+ "repr": "-1.810312679462298e+227"+ },+ {+ "bits": 13814903023825614928,+ "repr": "-0.09529275018619043"+ },+ {+ "bits": 1225649459375146666,+ "repr": "9.69921482966044e-227"+ },+ {+ "bits": 5608558268929244158,+ "repr": "9.099689856556653e+66"+ },+ {+ "bits": 3806978860244399239,+ "repr": "3.443055971747314e-54"+ },+ {+ "bits": 14020782043471796315,+ "repr": "-5449221772278.089"+ },+ {+ "bits": 4593849496280884104,+ "repr": "0.12993706084287404"+ },+ {+ "bits": 9642425590575345887,+ "repr": "-1.1553296653155887e-280"+ },+ {+ "bits": 8729259081297211052,+ "repr": "3.5588521991306914e+275"+ },+ {+ "bits": 9328836076374964114,+ "repr": "-1.3231074202763256e-301"+ },+ {+ "bits": 8401390514979675014,+ "repr": "4.350364704740197e+253"+ },+ {+ "bits": 11314334947590234717,+ "repr": "-6.82059481400024e-169"+ },+ {+ "bits": 11923848902996314439,+ "repr": "-3.753941795595619e-128"+ },+ {+ "bits": 89181193236863404,+ "repr": "1.051206452598355e-302"+ },+ {+ "bits": 4604697809123715932,+ "repr": "0.7241529130163644"+ },+ {+ "bits": 5005235529264996182,+ "repr": "4.28805609833526e+26"+ },+ {+ "bits": 9233416756166121270,+ "repr": "-5.475353750693471e-308"+ },+ {+ "bits": 9609220740108782175,+ "repr": "-7.211744760962637e-283"+ },+ {+ "bits": 6609783283180339508,+ "repr": "7.571468787329244e+133"+ },+ {+ "bits": 14368494557334399153,+ "repr": "-9.61495310041839e+35"+ },+ {+ "bits": 6848806284038947776,+ "repr": "7.121611305456496e+149"+ },+ {+ "bits": 13824041886246076060,+ "repr": "-0.3884797746486386"+ },+ {+ "bits": 13824226706761646232,+ "repr": "-0.39873937423909345"+ },+ {+ "bits": 16684503044589763664,+ "repr": "-6.073345960677659e+190"+ },+ {+ "bits": 13824643137582608176,+ "repr": "-0.4218559285188688"+ },+ {+ "bits": 401263691976641022,+ "repr": "7.56414039569491e-282"+ },+ {+ "bits": 13820373852092057808,+ "repr": "-0.21743148800175627"+ },+ {+ "bits": 13828432332708001336,+ "repr": "-0.7643970243386269"+ },+ {+ "bits": 10346713601097348675,+ "repr": "-1.441140439854267e-233"+ },+ {+ "bits": 13827579676249327876,+ "repr": "-0.6697331410871645"+ },+ {+ "bits": 4109644344368787500,+ "repr": "5.8716012172958825e-34"+ },+ {+ "bits": 17857929566809204564,+ "repr": "-1.6600538841954383e+269"+ },+ {+ "bits": 2066534327735434169,+ "repr": "1.542475583634864e-170"+ },+ {+ "bits": 10682655448574555463,+ "repr": "-3.901072702962902e-211"+ },+ {+ "bits": 4596231905678685248,+ "repr": "0.19606220503092864"+ },+ {+ "bits": 13812466423959743936,+ "repr": "-0.06198906713754182"+ },+ {+ "bits": 13830461487634031670,+ "repr": "-0.9896784762796702"+ },+ {+ "bits": 13827321319151591838,+ "repr": "-0.6410497412389764"+ },+ {+ "bits": 13828288103126194128,+ "repr": "-0.7483843240831849"+ },+ {+ "bits": 4598306597116587192,+ "repr": "0.25729292022942785"+ },+ {+ "bits": 11057383577952356444,+ "repr": "-4.531720421333765e-186"+ },+ {+ "bits": 17236064114719032059,+ "repr": "-4.453812109494359e+227"+ },+ {+ "bits": 9534306010799656019,+ "repr": "-6.83790483027492e-288"+ },+ {+ "bits": 13827394420567682718,+ "repr": "-0.6491656287666563"+ },+ {+ "bits": 6066806808785734653,+ "repr": "3.765218882639636e+97"+ },+ {+ "bits": 8498957997923866604,+ "repr": "1.4117944563038019e+260"+ },+ {+ "bits": 15253694426592953558,+ "repr": "-1.335729613952208e+95"+ },+ {+ "bits": 4594637761178376672,+ "repr": "0.151815806810375"+ },+ {+ "bits": 7119211094231375993,+ "repr": "8.408458084323141e+167"+ },+ {+ "bits": 10700407966451056912,+ "repr": "-5.9857295982131156e-210"+ },+ {+ "bits": 13822419352028010524,+ "repr": "-0.29841103229171195"+ },+ {+ "bits": 2047642749186125909,+ "repr": "8.632470305714516e-172"+ },+ {+ "bits": 4606232382445132444,+ "repr": "0.8945247764575757"+ },+ {+ "bits": 13824438445936658836,+ "repr": "-0.4104932596047999"+ },+ {+ "bits": 4589522659121384976,+ "repr": "0.06742160244294149"+ },+ {+ "bits": 4605883296796056456,+ "repr": "0.8557684839405377"+ },+ {+ "bits": 4603645473548719870,+ "repr": "0.6073201945170863"+ },+ {+ "bits": 13816078154361541568,+ "repr": "-0.11160096241026363"+ },+ {+ "bits": 10232544994618236177,+ "repr": "-3.243576385439265e-241"+ },+ {+ "bits": 7050318853898542234,+ "repr": "2.1382646367651565e+163"+ },+ {+ "bits": 3287431298812411793,+ "repr": "6.1466059061123735e-89"+ },+ {+ "bits": 4740290735220028365,+ "repr": "835362297.7300965"+ },+ {+ "bits": 12609497396840792874,+ "repr": "-2.465382314022459e-82"+ },+ {+ "bits": 7445561705456299874,+ "repr": "5.555160564811019e+189"+ },+ {+ "bits": 4605007699311686954,+ "repr": "0.758557635195449"+ },+ {+ "bits": 4600598046090649492,+ "repr": "0.3844938907673108"+ },+ {+ "bits": 11017781374404963409,+ "repr": "-1.0334443001407879e-188"+ },+ {+ "bits": 2795169236863741936,+ "repr": "7.998107154694322e-122"+ },+ {+ "bits": 8584580805569690948,+ "repr": "7.479787824241301e+265"+ },+ {+ "bits": 2579067122335364220,+ "repr": "2.8684840913466904e-136"+ },+ {+ "bits": 1388241245588073116,+ "repr": "7.260668990953273e-216"+ },+ {+ "bits": 8604709459958017388,+ "repr": "1.6811658196649859e+267"+ },+ {+ "bits": 4605662935943736380,+ "repr": "0.8313035147433605"+ },+ {+ "bits": 17310712592187320992,+ "repr": "-4.3478915096886304e+232"+ },+ {+ "bits": 3147536612513425672,+ "repr": "2.7702702263221246e-98"+ },+ {+ "bits": 13828692919237951654,+ "repr": "-0.7933279408844285"+ },+ {+ "bits": 9041528162682716410,+ "repr": "2.6528549290616266e+296"+ },+ {+ "bits": 5810007922975993354,+ "repr": "2.5633029144559545e+80"+ },+ {+ "bits": 4607138500740640332,+ "repr": "0.9951241159282715"+ },+ {+ "bits": 14913945052300398866,+ "repr": "-2.7581136620750646e+72"+ },+ {+ "bits": 142329244727869459,+ "repr": "3.830868659904082e-299"+ },+ {+ "bits": 4605428021343620788,+ "repr": "0.8052227549564663"+ },+ {+ "bits": 12300105013126405269,+ "repr": "-5.232552415370969e-103"+ },+ {+ "bits": 9912215171800975229,+ "repr": "-1.2410134818809876e-262"+ },+ {+ "bits": 15155883829349605912,+ "repr": "-4.0811925952697926e+88"+ },+ {+ "bits": 18147108325021650693,+ "repr": "-3.575308572491936e+288"+ },+ {+ "bits": 13365645667354462535,+ "repr": "-8.724366632253947e-32"+ },+ {+ "bits": 4568046352821628928,+ "repr": "0.0025586868974780685"+ }+ ],+ "structured": [+ {+ "value": {+ "b": 1,+ "a": 2,+ "z": [+ 1,+ "x",+ null,+ true,+ 2.5+ ]+ },+ "dumps": "{\"b\": 1, \"a\": 2, \"z\": [1, \"x\", null, true, 2.5]}"+ },+ {+ "value": {+ "nested": {+ "k": {+ "deep": [+ 1.5,+ -0.0+ ]+ }+ }+ },+ "dumps": "{\"nested\": {\"k\": {\"deep\": [1.5, -0.0]}}}"+ },+ {+ "value": [+ "a",+ "b\"c",+ "d\\e",+ "f\ng\th",+ "\u0000\u001f\u0001",+ " ",+ "/",+ "é中😀"+ ],+ "dumps": "[\"a\", \"b\\\"c\", \"d\\\\e\", \"f\\ng\\th\", \"\\u0000\\u001f\\u0001\", \" \", \"/\", \"é中😀\"]"+ },+ {+ "value": {+ "中文": "值",+ "emoji 😀": [+ 1e+16,+ 1e-05+ ]+ },+ "dumps": "{\"中文\": \"值\", \"emoji 😀\": [1e+16, 1e-05]}"+ },+ {+ "value": "a plain string",+ "dumps": "\"a plain string\""+ },+ {+ "value": 123456789012345678901234567890,+ "dumps": "123456789012345678901234567890"+ },+ {+ "value": -7,+ "dumps": "-7"+ },+ {+ "value": true,+ "dumps": "true"+ },+ {+ "value": null,+ "dumps": "null"+ },+ {+ "value": [],+ "dumps": "[]"+ },+ {+ "value": {},+ "dumps": "{}"+ }+ ],+ "round4": {+ "softmax": [+ {+ "bits": 4589525583459991770,+ "r4": 0.0675+ },+ {+ "bits": 4584037576854362206,+ "r4": 0.0291+ },+ {+ "bits": 4593218045933374577,+ "r4": 0.1187+ },+ {+ "bits": 4579158190373514029,+ "r4": 0.0139+ },+ {+ "bits": 4578655085100460870,+ "r4": 0.013+ },+ {+ "bits": 4593720025290028838,+ "r4": 0.1263+ },+ {+ "bits": 4587666940738677291,+ "r4": 0.0521+ },+ {+ "bits": 4578021608701955715,+ "r4": 0.0119+ },+ {+ "bits": 4593702520930446665,+ "r4": 0.1259+ },+ {+ "bits": 4598098953161382108,+ "r4": 0.2479+ },+ {+ "bits": 4560182358765983021,+ "r4": 0.0008+ },+ {+ "bits": 4596029667703128768,+ "r4": 0.1904+ },+ {+ "bits": 4557671498124579752,+ "r4": 0.0005+ },+ {+ "bits": 4566924027801210859,+ "r4": 0.0021+ },+ {+ "bits": 4577469115920489233,+ "r4": 0.011+ },+ {+ "bits": 4606873711031735959,+ "r4": 0.9657+ },+ {+ "bits": 4582378122923712419,+ "r4": 0.0233+ },+ {+ "bits": 4573359992738303116,+ "r4": 0.0058+ },+ {+ "bits": 4593953692310476537,+ "r4": 0.1328+ },+ {+ "bits": 4605271445586005531,+ "r4": 0.7878+ },+ {+ "bits": 4589961489173838960,+ "r4": 0.0735+ },+ {+ "bits": 4575238850430350770,+ "r4": 0.0074+ },+ {+ "bits": 4598183368668568644,+ "r4": 0.2505+ },+ {+ "bits": 4573244635558112151,+ "r4": 0.0057+ },+ {+ "bits": 4573950661038290407,+ "r4": 0.0063+ },+ {+ "bits": 4589225005455909920,+ "r4": 0.0633+ },+ {+ "bits": 4585777955940594684,+ "r4": 0.039+ },+ {+ "bits": 4599699665784804100,+ "r4": 0.3346+ },+ {+ "bits": 4591153976920342666,+ "r4": 0.0901+ },+ {+ "bits": 4580892593615767909,+ "r4": 0.0182+ },+ {+ "bits": 4571928549615365219,+ "r4": 0.0046+ },+ {+ "bits": 4586017893203924814,+ "r4": 0.0406+ },+ {+ "bits": 4574481806785464848,+ "r4": 0.0068+ },+ {+ "bits": 4583055967847404798,+ "r4": 0.0257+ },+ {+ "bits": 4587872403555793409,+ "r4": 0.0535+ },+ {+ "bits": 4587905222072829491,+ "r4": 0.0537+ },+ {+ "bits": 4569039916606730512,+ "r4": 0.003+ },+ {+ "bits": 4566840503402605634,+ "r4": 0.002+ },+ {+ "bits": 4599551102855142627,+ "r4": 0.3264+ },+ {+ "bits": 4591040599671985867,+ "r4": 0.0885+ },+ {+ "bits": 4570613266069406870,+ "r4": 0.0037+ },+ {+ "bits": 4571691057147968928,+ "r4": 0.0044+ },+ {+ "bits": 4602512745012782458,+ "r4": 0.4908+ },+ {+ "bits": 4590521638298557144,+ "r4": 0.0813+ },+ {+ "bits": 4607097181068668222,+ "r4": 0.9905+ },+ {+ "bits": 4576608836587401366,+ "r4": 0.0095+ },+ {+ "bits": 4593595500084211725,+ "r4": 0.1239+ },+ {+ "bits": 4577430227298154210,+ "r4": 0.0109+ },+ {+ "bits": 4594737038652637448,+ "r4": 0.1546+ },+ {+ "bits": 4584744580540143904,+ "r4": 0.0318+ },+ {+ "bits": 4586826590075162371,+ "r4": 0.0463+ },+ {+ "bits": 4600046964450934755,+ "r4": 0.3539+ },+ {+ "bits": 4554413211035837021,+ "r4": 0.0003+ },+ {+ "bits": 4587341588646429449,+ "r4": 0.0498+ },+ {+ "bits": 4559220138810540605,+ "r4": 0.0007+ },+ {+ "bits": 4580467224607518950,+ "r4": 0.0167+ },+ {+ "bits": 4586818799815075098,+ "r4": 0.0462+ },+ {+ "bits": 4567156950968430228,+ "r4": 0.0022+ },+ {+ "bits": 4562443176131503415,+ "r4": 0.001+ },+ {+ "bits": 4594675588156489283,+ "r4": 0.1529+ },+ {+ "bits": 4571514131151620381,+ "r4": 0.0042+ },+ {+ "bits": 4572011348131016036,+ "r4": 0.0047+ },+ {+ "bits": 4592929889643203085,+ "r4": 0.1147+ },+ {+ "bits": 4592374429000374336,+ "r4": 0.107+ },+ {+ "bits": 4575642756506065173,+ "r4": 0.0078+ },+ {+ "bits": 4576736167406822131,+ "r4": 0.0097+ },+ {+ "bits": 4591669947824267279,+ "r4": 0.0972+ },+ {+ "bits": 4596473388029192233,+ "r4": 0.2028+ },+ {+ "bits": 4568934420811030797,+ "r4": 0.0029+ },+ {+ "bits": 4588163414328114907,+ "r4": 0.0555+ },+ {+ "bits": 4573742600318857643,+ "r4": 0.0062+ },+ {+ "bits": 4591332884481739552,+ "r4": 0.0925+ },+ {+ "bits": 4599141824526796845,+ "r4": 0.3037+ },+ {+ "bits": 4575653140144919184,+ "r4": 0.0078+ },+ {+ "bits": 4569356313542633477,+ "r4": 0.0031+ },+ {+ "bits": 4582115042769917936,+ "r4": 0.0224+ },+ {+ "bits": 4600658456015694861,+ "r4": 0.3878+ },+ {+ "bits": 4576368781709103512,+ "r4": 0.009+ },+ {+ "bits": 4592637445682915043,+ "r4": 0.1106+ },+ {+ "bits": 4589863138242217152,+ "r4": 0.0721+ },+ {+ "bits": 4589134483542381882,+ "r4": 0.0623+ },+ {+ "bits": 4589337292656375857,+ "r4": 0.0648+ },+ {+ "bits": 4581741623095720790,+ "r4": 0.0211+ },+ {+ "bits": 4589221786793456761,+ "r4": 0.0632+ },+ {+ "bits": 4582995357843837688,+ "r4": 0.0255+ },+ {+ "bits": 4570184191198112038,+ "r4": 0.0035+ },+ {+ "bits": 4550241007511577206,+ "r4": 0.0002+ },+ {+ "bits": 4594248865306755479,+ "r4": 0.141+ },+ {+ "bits": 4563212460381267085,+ "r4": 0.0012+ },+ {+ "bits": 4559799643885933774,+ "r4": 0.0007+ },+ {+ "bits": 4570069200346171082,+ "r4": 0.0034+ },+ {+ "bits": 4595586470350458262,+ "r4": 0.1781+ },+ {+ "bits": 4599742344811011342,+ "r4": 0.337+ },+ {+ "bits": 4571248376115136452,+ "r4": 0.004+ },+ {+ "bits": 4598333059550008913,+ "r4": 0.2588+ },+ {+ "bits": 4589534662500652214,+ "r4": 0.0676+ },+ {+ "bits": 4589603048686020729,+ "r4": 0.0685+ },+ {+ "bits": 4590860189497479601,+ "r4": 0.086+ },+ {+ "bits": 4573421070228342958,+ "r4": 0.0059+ },+ {+ "bits": 4571606075155193589,+ "r4": 0.0043+ },+ {+ "bits": 4562484556404207299,+ "r4": 0.001+ },+ {+ "bits": 4573117780734764366,+ "r4": 0.0056+ },+ {+ "bits": 4576688103700257745,+ "r4": 0.0096+ },+ {+ "bits": 4578531826724291150,+ "r4": 0.0128+ },+ {+ "bits": 4606545185406000546,+ "r4": 0.9293+ },+ {+ "bits": 4581089424487341974,+ "r4": 0.0188+ },+ {+ "bits": 4577995169898519853,+ "r4": 0.0119+ },+ {+ "bits": 4560525616272379386,+ "r4": 0.0008+ },+ {+ "bits": 4600274200776705318,+ "r4": 0.3665+ },+ {+ "bits": 4600481355737187134,+ "r4": 0.378+ },+ {+ "bits": 4588414405781735369,+ "r4": 0.0573+ },+ {+ "bits": 4596308787766852936,+ "r4": 0.1982+ },+ {+ "bits": 4593860245212232331,+ "r4": 0.1302+ },+ {+ "bits": 4570649933280618870,+ "r4": 0.0037+ },+ {+ "bits": 4590611258214513624,+ "r4": 0.0825+ },+ {+ "bits": 4580214403272232225,+ "r4": 0.0158+ },+ {+ "bits": 4584450891648609496,+ "r4": 0.0305+ },+ {+ "bits": 4557736941257740025,+ "r4": 0.0005+ },+ {+ "bits": 4577251445156110085,+ "r4": 0.0106+ },+ {+ "bits": 4603669765483393197,+ "r4": 0.61+ },+ {+ "bits": 4567905262300472954,+ "r4": 0.0025+ },+ {+ "bits": 4562300979218656506,+ "r4": 0.001+ },+ {+ "bits": 4573109045831523174,+ "r4": 0.0056+ },+ {+ "bits": 4567274100938918055,+ "r4": 0.0022+ },+ {+ "bits": 4592015357393368892,+ "r4": 0.102+ },+ {+ "bits": 4568569805298493519,+ "r4": 0.0028+ },+ {+ "bits": 4604920384796003211,+ "r4": 0.7489+ },+ {+ "bits": 4598195687925934313,+ "r4": 0.2511+ },+ {+ "bits": 4590082533759838794,+ "r4": 0.0752+ },+ {+ "bits": 4595468249077553405,+ "r4": 0.1749+ },+ {+ "bits": 4584707822185021205,+ "r4": 0.0316+ },+ {+ "bits": 4581317069939886860,+ "r4": 0.0196+ },+ {+ "bits": 4579160999835377467,+ "r4": 0.0139+ },+ {+ "bits": 4595139609895720596,+ "r4": 0.1657+ },+ {+ "bits": 4584887358650145540,+ "r4": 0.0328+ },+ {+ "bits": 4556646204060718452,+ "r4": 0.0004+ },+ {+ "bits": 4602424594681818560,+ "r4": 0.4859+ },+ {+ "bits": 4583183491698326338,+ "r4": 0.0261+ },+ {+ "bits": 4583174238399405576,+ "r4": 0.0261+ },+ {+ "bits": 4580100846342106455,+ "r4": 0.0155+ },+ {+ "bits": 4586586652294044795,+ "r4": 0.0446+ },+ {+ "bits": 4590934244871047409,+ "r4": 0.087+ },+ {+ "bits": 4559741243300442229,+ "r4": 0.0007+ },+ {+ "bits": 4600538030962149741,+ "r4": 0.3812+ },+ {+ "bits": 4590459632805217292,+ "r4": 0.0804+ },+ {+ "bits": 4573267797036131368,+ "r4": 0.0057+ },+ {+ "bits": 4585169246580070176,+ "r4": 0.0348+ },+ {+ "bits": 4588110950540144130,+ "r4": 0.0552+ },+ {+ "bits": 4570591723743862592,+ "r4": 0.0037+ },+ {+ "bits": 4591116470638636872,+ "r4": 0.0895+ },+ {+ "bits": 4568342482299276987,+ "r4": 0.0027+ },+ {+ "bits": 4565447613098033343,+ "r4": 0.0017+ },+ {+ "bits": 4594282702631377751,+ "r4": 0.142+ },+ {+ "bits": 4561816812008558045,+ "r4": 0.0009+ },+ {+ "bits": 4567317800402152062,+ "r4": 0.0022+ },+ {+ "bits": 4598439217706868998,+ "r4": 0.2647+ },+ {+ "bits": 4586875146931481950,+ "r4": 0.0466+ },+ {+ "bits": 4567735202634828705,+ "r4": 0.0024+ },+ {+ "bits": 4582376181688000451,+ "r4": 0.0233+ },+ {+ "bits": 4585888728322327127,+ "r4": 0.0397+ },+ {+ "bits": 4602770144784653748,+ "r4": 0.5101+ },+ {+ "bits": 4581086935199485879,+ "r4": 0.0188+ },+ {+ "bits": 4591459287143061042,+ "r4": 0.0943+ },+ {+ "bits": 4588926310211515478,+ "r4": 0.0608+ },+ {+ "bits": 4591098213101983887,+ "r4": 0.0893+ },+ {+ "bits": 4567791457487337130,+ "r4": 0.0024+ },+ {+ "bits": 4576964457131617842,+ "r4": 0.0101+ },+ {+ "bits": 4549130462697278897,+ "r4": 0.0001+ },+ {+ "bits": 4576145156568525230,+ "r4": 0.0087+ },+ {+ "bits": 4577194279058863748,+ "r4": 0.0105+ },+ {+ "bits": 4584406177556782713,+ "r4": 0.0304+ },+ {+ "bits": 4576439751410547209,+ "r4": 0.0092+ },+ {+ "bits": 4573092764530487099,+ "r4": 0.0056+ },+ {+ "bits": 4604450530379278839,+ "r4": 0.6967+ },+ {+ "bits": 4565564611901547052,+ "r4": 0.0017+ },+ {+ "bits": 4565450796203378788,+ "r4": 0.0017+ },+ {+ "bits": 4572120354458071007,+ "r4": 0.0047+ },+ {+ "bits": 4579331369402104496,+ "r4": 0.0142+ },+ {+ "bits": 4583734181178185496,+ "r4": 0.028+ },+ {+ "bits": 4582181986685615718,+ "r4": 0.0226+ },+ {+ "bits": 4569699137259122358,+ "r4": 0.0033+ },+ {+ "bits": 4567634009497547031,+ "r4": 0.0024+ },+ {+ "bits": 4575693829431911250,+ "r4": 0.0079+ },+ {+ "bits": 4578547513099349522,+ "r4": 0.0128+ },+ {+ "bits": 4589511519204187749,+ "r4": 0.0673+ },+ {+ "bits": 4557943166187705586,+ "r4": 0.0005+ },+ {+ "bits": 4602545362840182935,+ "r4": 0.4926+ },+ {+ "bits": 4570905632471976294,+ "r4": 0.0038+ },+ {+ "bits": 4595389850569930946,+ "r4": 0.1727+ },+ {+ "bits": 4596581842224170233,+ "r4": 0.2058+ },+ {+ "bits": 4569810940309659250,+ "r4": 0.0033+ },+ {+ "bits": 4547537216152485454,+ "r4": 0.0001+ },+ {+ "bits": 4571531323305756780,+ "r4": 0.0042+ },+ {+ "bits": 4563456118396289179,+ "r4": 0.0013+ },+ {+ "bits": 4558698169852013623,+ "r4": 0.0006+ },+ {+ "bits": 4582789744842066913,+ "r4": 0.0247+ },+ {+ "bits": 4589767728314984578,+ "r4": 0.0708+ },+ {+ "bits": 4603948479799033561,+ "r4": 0.641+ },+ {+ "bits": 4578244772321030330,+ "r4": 0.0123+ },+ {+ "bits": 4598367877993073761,+ "r4": 0.2607+ },+ {+ "bits": 4579927847684114689,+ "r4": 0.0152+ },+ {+ "bits": 4594339320894926706,+ "r4": 0.1435+ },+ {+ "bits": 4587022516301545174,+ "r4": 0.0476+ },+ {+ "bits": 4575712236268526380,+ "r4": 0.0079+ },+ {+ "bits": 4558505868874375520,+ "r4": 0.0006+ },+ {+ "bits": 4601954425006565494,+ "r4": 0.4598+ },+ {+ "bits": 4590211806943570373,+ "r4": 0.077+ },+ {+ "bits": 4561228664768358746,+ "r4": 0.0009+ },+ {+ "bits": 4596048629912416222,+ "r4": 0.191+ },+ {+ "bits": 4580047569966812495,+ "r4": 0.0154+ },+ {+ "bits": 4588276067641484657,+ "r4": 0.0563+ },+ {+ "bits": 4584804319903514495,+ "r4": 0.0322+ },+ {+ "bits": 4600289536322017552,+ "r4": 0.3674+ },+ {+ "bits": 4598328047608505145,+ "r4": 0.2585+ },+ {+ "bits": 4597896293509004619,+ "r4": 0.2423+ },+ {+ "bits": 4591846342451451016,+ "r4": 0.0997+ },+ {+ "bits": 4561789335595505705,+ "r4": 0.0009+ },+ {+ "bits": 4566191532386717019,+ "r4": 0.0019+ },+ {+ "bits": 4588550911263831221,+ "r4": 0.0582+ },+ {+ "bits": 4562230958946313052,+ "r4": 0.001+ },+ {+ "bits": 4604537800567524560,+ "r4": 0.7064+ },+ {+ "bits": 4569815838970158263,+ "r4": 0.0033+ },+ {+ "bits": 4577437786554483471,+ "r4": 0.0109+ },+ {+ "bits": 4562400074427442266,+ "r4": 0.001+ },+ {+ "bits": 4572694295790868853,+ "r4": 0.0052+ },+ {+ "bits": 4575781188542221075,+ "r4": 0.008+ },+ {+ "bits": 4575360904369031330,+ "r4": 0.0076+ },+ {+ "bits": 4562867045016899138,+ "r4": 0.0011+ },+ {+ "bits": 4595328773387559065,+ "r4": 0.171+ },+ {+ "bits": 4582400256871046066,+ "r4": 0.0234+ },+ {+ "bits": 4597728209131144196,+ "r4": 0.2376+ },+ {+ "bits": 4604845022316606522,+ "r4": 0.7405+ },+ {+ "bits": 4580624959508831052,+ "r4": 0.0172+ },+ {+ "bits": 4557307205265794372,+ "r4": 0.0005+ },+ {+ "bits": 4571497802877817504,+ "r4": 0.0042+ },+ {+ "bits": 4603751828592471704,+ "r4": 0.6191+ },+ {+ "bits": 4572928803398270357,+ "r4": 0.0054+ },+ {+ "bits": 4569426260154744046,+ "r4": 0.0032+ },+ {+ "bits": 4578344288466003739,+ "r4": 0.0125+ },+ {+ "bits": 4599557700720449956,+ "r4": 0.3267+ },+ {+ "bits": 4584924113757585432,+ "r4": 0.0331+ },+ {+ "bits": 4592567284233734836,+ "r4": 0.1097+ },+ {+ "bits": 4605669710758337228,+ "r4": 0.8321+ },+ {+ "bits": 4588558422561537489,+ "r4": 0.0583+ },+ {+ "bits": 4591771716868371716,+ "r4": 0.0986+ },+ {+ "bits": 4596671586094267896,+ "r4": 0.2083+ },+ {+ "bits": 4599270895303937123,+ "r4": 0.3108+ },+ {+ "bits": 4563392428080026407,+ "r4": 0.0012+ },+ {+ "bits": 4592995757917319539,+ "r4": 0.1156+ },+ {+ "bits": 4561372379390274485,+ "r4": 0.0009+ },+ {+ "bits": 4567990545218443360,+ "r4": 0.0025+ },+ {+ "bits": 4594430626889687812,+ "r4": 0.1461+ },+ {+ "bits": 4593017146944576031,+ "r4": 0.1159+ },+ {+ "bits": 4600066802408514993,+ "r4": 0.355+ },+ {+ "bits": 4590474246063219751,+ "r4": 0.0806+ },+ {+ "bits": 4592593725221021586,+ "r4": 0.11+ },+ {+ "bits": 4585066317991010741,+ "r4": 0.034+ },+ {+ "bits": 4593223894082629766,+ "r4": 0.1188+ },+ {+ "bits": 4593431732908729870,+ "r4": 0.1217+ },+ {+ "bits": 4595647120278006538,+ "r4": 0.1798+ },+ {+ "bits": 4598993001646283785,+ "r4": 0.2954+ },+ {+ "bits": 4604521727935828475,+ "r4": 0.7046+ },+ {+ "bits": 4560529113907243006,+ "r4": 0.0008+ },+ {+ "bits": 4577435080959912443,+ "r4": 0.0109+ },+ {+ "bits": 4595867859920828895,+ "r4": 0.186+ },+ {+ "bits": 4576217655633436006,+ "r4": 0.0088+ },+ {+ "bits": 4574636656932076084,+ "r4": 0.0069+ },+ {+ "bits": 4572759842002843498,+ "r4": 0.0053+ },+ {+ "bits": 4553179965017931033,+ "r4": 0.0002+ },+ {+ "bits": 4586087056625484850,+ "r4": 0.0411+ },+ {+ "bits": 4579354704586205405,+ "r4": 0.0142+ },+ {+ "bits": 4603094224976077076,+ "r4": 0.5461+ },+ {+ "bits": 4554083344372753761,+ "r4": 0.0003+ },+ {+ "bits": 4594087080623080050,+ "r4": 0.1365+ },+ {+ "bits": 4585171111092044940,+ "r4": 0.0348+ },+ {+ "bits": 4575029454041949584,+ "r4": 0.0073+ },+ {+ "bits": 4560135439964027049,+ "r4": 0.0008+ },+ {+ "bits": 4599006684735116932,+ "r4": 0.2962+ },+ {+ "bits": 4585230100869993373,+ "r4": 0.0352+ },+ {+ "bits": 4591388672778229703,+ "r4": 0.0933+ },+ {+ "bits": 4579391927406422887,+ "r4": 0.0143+ },+ {+ "bits": 4603228801361994974,+ "r4": 0.5611+ },+ {+ "bits": 4598661507744804195,+ "r4": 0.277+ },+ {+ "bits": 4583669416268608480,+ "r4": 0.0278+ },+ {+ "bits": 4599894841073310016,+ "r4": 0.3455+ },+ {+ "bits": 4599972147266323999,+ "r4": 0.3497+ },+ {+ "bits": 4572337419548402103,+ "r4": 0.0049+ },+ {+ "bits": 4595972828506363551,+ "r4": 0.1889+ },+ {+ "bits": 4554929866097667083,+ "r4": 0.0003+ },+ {+ "bits": 4564655738659774374,+ "r4": 0.0015+ },+ {+ "bits": 4585019817112971967,+ "r4": 0.0337+ },+ {+ "bits": 4586231125624025455,+ "r4": 0.0421+ },+ {+ "bits": 4589764914042685894,+ "r4": 0.0708+ },+ {+ "bits": 4593043373451446665,+ "r4": 0.1163+ },+ {+ "bits": 4572842069538723554,+ "r4": 0.0054+ },+ {+ "bits": 4594956735971006195,+ "r4": 0.1607+ },+ {+ "bits": 4572707867532267687,+ "r4": 0.0053+ },+ {+ "bits": 4600339421272050861,+ "r4": 0.3701+ },+ {+ "bits": 4591579850766078186,+ "r4": 0.096+ },+ {+ "bits": 4598404405831249066,+ "r4": 0.2627+ },+ {+ "bits": 4603169955909270613,+ "r4": 0.5545+ },+ {+ "bits": 4585055499106343405,+ "r4": 0.034+ },+ {+ "bits": 4587772401704622506,+ "r4": 0.0528+ },+ {+ "bits": 4569236257443271247,+ "r4": 0.0031+ },+ {+ "bits": 4582186833569204909,+ "r4": 0.0227+ },+ {+ "bits": 4606950673752348632,+ "r4": 0.9743+ },+ {+ "bits": 4574924834287177947,+ "r4": 0.0072+ },+ {+ "bits": 4578120710327853580,+ "r4": 0.0121+ },+ {+ "bits": 4585083314974646753,+ "r4": 0.0342+ },+ {+ "bits": 4573485265007482111,+ "r4": 0.0059+ },+ {+ "bits": 4567664728263876742,+ "r4": 0.0024+ },+ {+ "bits": 4574651776618413387,+ "r4": 0.0069+ },+ {+ "bits": 4572859215303158699,+ "r4": 0.0054+ },+ {+ "bits": 4592307029178010575,+ "r4": 0.1061+ },+ {+ "bits": 4555635484364787584,+ "r4": 0.0004+ },+ {+ "bits": 4559607785812167240,+ "r4": 0.0007+ },+ {+ "bits": 4588473506389067086,+ "r4": 0.0577+ },+ {+ "bits": 4578416924225048650,+ "r4": 0.0126+ },+ {+ "bits": 4566748666490087891,+ "r4": 0.002+ },+ {+ "bits": 4603370967035772434,+ "r4": 0.5768+ },+ {+ "bits": 4594105463755913227,+ "r4": 0.137+ },+ {+ "bits": 4571908556524451551,+ "r4": 0.0046+ },+ {+ "bits": 4578676183815477727,+ "r4": 0.013+ },+ {+ "bits": 4579809964216427217,+ "r4": 0.015+ },+ {+ "bits": 4600522602761401291,+ "r4": 0.3803+ },+ {+ "bits": 4603756927378269722,+ "r4": 0.6197+ },+ {+ "bits": 4604928981187601748,+ "r4": 0.7498+ },+ {+ "bits": 4594123955658617375,+ "r4": 0.1376+ },+ {+ "bits": 4591084246724448541,+ "r4": 0.0891+ },+ {+ "bits": 4582440437815934991,+ "r4": 0.0235+ },+ {+ "bits": 4588917242128339732,+ "r4": 0.0608+ },+ {+ "bits": 4596925209377642361,+ "r4": 0.2153+ },+ {+ "bits": 4602063606428156443,+ "r4": 0.4658+ },+ {+ "bits": 4576836818779964169,+ "r4": 0.0099+ },+ {+ "bits": 4572364254374886186,+ "r4": 0.005+ },+ {+ "bits": 4597932780359410561,+ "r4": 0.2433+ },+ {+ "bits": 4578538051037980681,+ "r4": 0.0128+ },+ {+ "bits": 4598475248985284366,+ "r4": 0.2667+ },+ {+ "bits": 4571061984097599116,+ "r4": 0.0039+ },+ {+ "bits": 4589686763062199815,+ "r4": 0.0697+ },+ {+ "bits": 4592008884489287343,+ "r4": 0.1019+ },+ {+ "bits": 4582004009493500331,+ "r4": 0.022+ },+ {+ "bits": 4575080566657144079,+ "r4": 0.0073+ },+ {+ "bits": 4584128879876083095,+ "r4": 0.0294+ },+ {+ "bits": 4597669485469864539,+ "r4": 0.236+ },+ {+ "bits": 4598160951436914908,+ "r4": 0.2496+ },+ {+ "bits": 4560088761315837161,+ "r4": 0.0008+ },+ {+ "bits": 4603682166571567330,+ "r4": 0.6114+ },+ {+ "bits": 4582174969793834535,+ "r4": 0.0226+ },+ {+ "bits": 4577003637488103704,+ "r4": 0.0101+ },+ {+ "bits": 4599839593960525730,+ "r4": 0.3424+ },+ {+ "bits": 4578909082560153023,+ "r4": 0.0135+ },+ {+ "bits": 4559490949318932557,+ "r4": 0.0007+ },+ {+ "bits": 4575786681100828211,+ "r4": 0.008+ },+ {+ "bits": 4588663420570272109,+ "r4": 0.059+ },+ {+ "bits": 4599637286932030375,+ "r4": 0.3312+ },+ {+ "bits": 4555925435208650435,+ "r4": 0.0004+ },+ {+ "bits": 4576481221849427264,+ "r4": 0.0092+ },+ {+ "bits": 4590565454595653281,+ "r4": 0.0819+ },+ {+ "bits": 4578570773655569346,+ "r4": 0.0129+ },+ {+ "bits": 4563484906766287476,+ "r4": 0.0013+ },+ {+ "bits": 4581223220552165023,+ "r4": 0.0193+ },+ {+ "bits": 4579250408139935999,+ "r4": 0.014+ },+ {+ "bits": 4594477919072591372,+ "r4": 0.1474+ },+ {+ "bits": 4562407309712548954,+ "r4": 0.001+ },+ {+ "bits": 4574470394747397543,+ "r4": 0.0068+ },+ {+ "bits": 4555287306513704700,+ "r4": 0.0004+ },+ {+ "bits": 4598902754022866561,+ "r4": 0.2904+ },+ {+ "bits": 4558301588178289549,+ "r4": 0.0006+ },+ {+ "bits": 4558578213189188214,+ "r4": 0.0006+ },+ {+ "bits": 4578762906162177949,+ "r4": 0.0132+ },+ {+ "bits": 4565954336533466223,+ "r4": 0.0018+ },+ {+ "bits": 4565236105169274784,+ "r4": 0.0016+ },+ {+ "bits": 4559080080647084139,+ "r4": 0.0006+ },+ {+ "bits": 4576776970152485955,+ "r4": 0.0098+ },+ {+ "bits": 4558522502456749214,+ "r4": 0.0006+ },+ {+ "bits": 4561125420029597373,+ "r4": 0.0009+ },+ {+ "bits": 4565463361402698927,+ "r4": 0.0017+ },+ {+ "bits": 4586833232548174451,+ "r4": 0.0463+ },+ {+ "bits": 4599989480004310385,+ "r4": 0.3507+ },+ {+ "bits": 4600958184997684193,+ "r4": 0.4045+ },+ {+ "bits": 4587461167041965950,+ "r4": 0.0507+ },+ {+ "bits": 4570917216519948370,+ "r4": 0.0038+ },+ {+ "bits": 4577031515990483325,+ "r4": 0.0102+ },+ {+ "bits": 4579002362804872502,+ "r4": 0.0136+ },+ {+ "bits": 4560894123038213055,+ "r4": 0.0008+ },+ {+ "bits": 4571586126062462626,+ "r4": 0.0043+ },+ {+ "bits": 4567767164861978230,+ "r4": 0.0024+ },+ {+ "bits": 4591051806845095565,+ "r4": 0.0886+ },+ {+ "bits": 4576248424930985205,+ "r4": 0.0088+ },+ {+ "bits": 4559139162233343055,+ "r4": 0.0007+ },+ {+ "bits": 4554410829326036417,+ "r4": 0.0003+ },+ {+ "bits": 4556240884082836260,+ "r4": 0.0004+ },+ {+ "bits": 4567513167270141685,+ "r4": 0.0023+ },+ {+ "bits": 4578121988577921794,+ "r4": 0.0121+ },+ {+ "bits": 4595757732486122799,+ "r4": 0.1829+ },+ {+ "bits": 4585972128896459405,+ "r4": 0.0403+ },+ {+ "bits": 4569412892327609760,+ "r4": 0.0032+ },+ {+ "bits": 4560571289322315603,+ "r4": 0.0008+ },+ {+ "bits": 4583452449380319454,+ "r4": 0.027+ },+ {+ "bits": 4596925042939421660,+ "r4": 0.2153+ },+ {+ "bits": 4595705846343761120,+ "r4": 0.1815+ },+ {+ "bits": 4569710222030646758,+ "r4": 0.0033+ },+ {+ "bits": 4578324197618864767,+ "r4": 0.0124+ },+ {+ "bits": 4581016105454257453,+ "r4": 0.0186+ },+ {+ "bits": 4585982771048854597,+ "r4": 0.0404+ },+ {+ "bits": 4598328516367383547,+ "r4": 0.2585+ },+ {+ "bits": 4592330368360677146,+ "r4": 0.1064+ },+ {+ "bits": 4569648127814769091,+ "r4": 0.0033+ },+ {+ "bits": 4579730444913376483,+ "r4": 0.0149+ },+ {+ "bits": 4579083202555527301,+ "r4": 0.0138+ },+ {+ "bits": 4557855751150251549,+ "r4": 0.0005+ },+ {+ "bits": 4586762143635593710,+ "r4": 0.0458+ },+ {+ "bits": 4599661664752207860,+ "r4": 0.3325+ },+ {+ "bits": 4571891638196405831,+ "r4": 0.0045+ },+ {+ "bits": 4595348396897602946,+ "r4": 0.1715+ },+ {+ "bits": 4589690895824315864,+ "r4": 0.0698+ },+ {+ "bits": 4597708720126878470,+ "r4": 0.2371+ },+ {+ "bits": 4567472445211375852,+ "r4": 0.0023+ },+ {+ "bits": 4594367957448242371,+ "r4": 0.1443+ },+ {+ "bits": 4587337917729654313,+ "r4": 0.0498+ },+ {+ "bits": 4582340911834824106,+ "r4": 0.0232+ },+ {+ "bits": 4557979235673698086,+ "r4": 0.0005+ },+ {+ "bits": 4582552632785113152,+ "r4": 0.0239+ },+ {+ "bits": 4604544268001658478,+ "r4": 0.7071+ },+ {+ "bits": 4574081762084476418,+ "r4": 0.0064+ },+ {+ "bits": 4576426992570617037,+ "r4": 0.0091+ },+ {+ "bits": 4584949025782965167,+ "r4": 0.0332+ },+ {+ "bits": 4577765842038536206,+ "r4": 0.0115+ },+ {+ "bits": 4580235458219243420,+ "r4": 0.0159+ },+ {+ "bits": 4570914277024238239,+ "r4": 0.0038+ },+ {+ "bits": 4592616369459055611,+ "r4": 0.1104+ },+ {+ "bits": 4569229407863385371,+ "r4": 0.0031+ },+ {+ "bits": 4575661369436861724,+ "r4": 0.0078+ },+ {+ "bits": 4577560495616997280,+ "r4": 0.0111+ },+ {+ "bits": 4576348064476470464,+ "r4": 0.009+ },+ {+ "bits": 4590173082648218514,+ "r4": 0.0764+ },+ {+ "bits": 4585955454902843427,+ "r4": 0.0402+ },+ {+ "bits": 4591285370629057754,+ "r4": 0.0919+ },+ {+ "bits": 4598637036613796669,+ "r4": 0.2756+ },+ {+ "bits": 4578599677692288347,+ "r4": 0.0129+ },+ {+ "bits": 4591796852248384895,+ "r4": 0.099+ },+ {+ "bits": 4586267368546863220,+ "r4": 0.0424+ },+ {+ "bits": 4579778876087862033,+ "r4": 0.015+ },+ {+ "bits": 4595372010240970070,+ "r4": 0.1722+ },+ {+ "bits": 4566243914226569959,+ "r4": 0.0019+ },+ {+ "bits": 4598416661102933481,+ "r4": 0.2634+ },+ {+ "bits": 4600656893579705729,+ "r4": 0.3878+ },+ {+ "bits": 4599955703580560534,+ "r4": 0.3488+ },+ {+ "bits": 4558253845122282643,+ "r4": 0.0006+ },+ {+ "bits": 4590095915066964361,+ "r4": 0.0754+ },+ {+ "bits": 4588778262033265644,+ "r4": 0.0598+ },+ {+ "bits": 4583620159289532730,+ "r4": 0.0276+ },+ {+ "bits": 4593518842655834804,+ "r4": 0.1229+ },+ {+ "bits": 4588219044112160905,+ "r4": 0.0559+ },+ {+ "bits": 4555246108356431907,+ "r4": 0.0004+ },+ {+ "bits": 4576715644657298885,+ "r4": 0.0096+ },+ {+ "bits": 4561286203666109538,+ "r4": 0.0009+ },+ {+ "bits": 4569977340153818032,+ "r4": 0.0034+ },+ {+ "bits": 4577184200309331306,+ "r4": 0.0105+ },+ {+ "bits": 4574513386571917842,+ "r4": 0.0068+ },+ {+ "bits": 4592823750266311670,+ "r4": 0.1132+ },+ {+ "bits": 4567417626279810078,+ "r4": 0.0023+ },+ {+ "bits": 4571943315896473259,+ "r4": 0.0046+ },+ {+ "bits": 4572924903854493819,+ "r4": 0.0054+ },+ {+ "bits": 4583727063887513237,+ "r4": 0.028+ },+ {+ "bits": 4585526367835068681,+ "r4": 0.0372+ },+ {+ "bits": 4601429772000102868,+ "r4": 0.4307+ },+ {+ "bits": 4572226390143825553,+ "r4": 0.0048+ },+ {+ "bits": 4602451061385763290,+ "r4": 0.4874+ },+ {+ "bits": 4602199847750697762,+ "r4": 0.4734+ },+ {+ "bits": 4585814654706456593,+ "r4": 0.0392+ },+ {+ "bits": 4582483105854397192,+ "r4": 0.0237+ },+ {+ "bits": 4585304840161413907,+ "r4": 0.0357+ },+ {+ "bits": 4562640333329516036,+ "r4": 0.0011+ },+ {+ "bits": 4568212495151094862,+ "r4": 0.0026+ },+ {+ "bits": 4570642008186240349,+ "r4": 0.0037+ },+ {+ "bits": 4567460540407842137,+ "r4": 0.0023+ },+ {+ "bits": 4571375244644145813,+ "r4": 0.0041+ },+ {+ "bits": 4560797447929723660,+ "r4": 0.0008+ },+ {+ "bits": 4606162489096629009,+ "r4": 0.8868+ },+ {+ "bits": 4578196429433008388,+ "r4": 0.0122+ },+ {+ "bits": 4583323824536555420,+ "r4": 0.0266+ },+ {+ "bits": 4556211898283163482,+ "r4": 0.0004+ },+ {+ "bits": 4597661183290168124,+ "r4": 0.2357+ },+ {+ "bits": 4575784993545659182,+ "r4": 0.008+ },+ {+ "bits": 4598200174952613411,+ "r4": 0.2514+ },+ {+ "bits": 4595334439637176191,+ "r4": 0.1712+ },+ {+ "bits": 4589731975409964193,+ "r4": 0.0703+ },+ {+ "bits": 4582930826127835051,+ "r4": 0.0252+ },+ {+ "bits": 4591368398144424544,+ "r4": 0.093+ },+ {+ "bits": 4594395697454567253,+ "r4": 0.1451+ },+ {+ "bits": 4598281634083361202,+ "r4": 0.2559+ },+ {+ "bits": 4574469465166313367,+ "r4": 0.0068+ },+ {+ "bits": 4531410211613255923,+ "r4": 0.0+ },+ {+ "bits": 4563341173031119958,+ "r4": 0.0012+ },+ {+ "bits": 4568723232938243817,+ "r4": 0.0029+ },+ {+ "bits": 4559238240440071474,+ "r4": 0.0007+ },+ {+ "bits": 4564518726160925346,+ "r4": 0.0015+ },+ {+ "bits": 4589149474471886549,+ "r4": 0.0624+ },+ {+ "bits": 4582130668395472873,+ "r4": 0.0225+ },+ {+ "bits": 4571964679442821245,+ "r4": 0.0046+ },+ {+ "bits": 4562619726481265058,+ "r4": 0.0011+ },+ {+ "bits": 4603944708401531261,+ "r4": 0.6405+ },+ {+ "bits": 4583721809788243166,+ "r4": 0.028+ },+ {+ "bits": 4558176192146350037,+ "r4": 0.0005+ },+ {+ "bits": 4564223399462533272,+ "r4": 0.0014+ },+ {+ "bits": 4590363926013102731,+ "r4": 0.0791+ },+ {+ "bits": 4600648391763566244,+ "r4": 0.3873+ },+ {+ "bits": 4576219035313670301,+ "r4": 0.0088+ },+ {+ "bits": 4573422823050891240,+ "r4": 0.0059+ },+ {+ "bits": 4594429715751768148,+ "r4": 0.146+ },+ {+ "bits": 4563760955670645205,+ "r4": 0.0013+ },+ {+ "bits": 4591449791833208630,+ "r4": 0.0942+ },+ {+ "bits": 4563643838405969946,+ "r4": 0.0013+ },+ {+ "bits": 4598037060715653804,+ "r4": 0.2462+ },+ {+ "bits": 4599723513223040797,+ "r4": 0.3359+ },+ {+ "bits": 4591933993165689043,+ "r4": 0.1009+ },+ {+ "bits": 4603247775584634455,+ "r4": 0.5632+ },+ {+ "bits": 4598301531560422541,+ "r4": 0.257+ },+ {+ "bits": 4581251018044725764,+ "r4": 0.0194+ },+ {+ "bits": 4588842472316132277,+ "r4": 0.0602+ },+ {+ "bits": 4562642770097322268,+ "r4": 0.0011+ },+ {+ "bits": 4579299321511071299,+ "r4": 0.0141+ },+ {+ "bits": 4590175593497909463,+ "r4": 0.0765+ },+ {+ "bits": 4581573980888607965,+ "r4": 0.0205+ },+ {+ "bits": 4570917492211010055,+ "r4": 0.0038+ },+ {+ "bits": 4566795166581378075,+ "r4": 0.002+ },+ {+ "bits": 4555632278550796917,+ "r4": 0.0004+ },+ {+ "bits": 4568619963208099961,+ "r4": 0.0028+ },+ {+ "bits": 4588437821531718977,+ "r4": 0.0574+ },+ {+ "bits": 4590033301216947627,+ "r4": 0.0745+ },+ {+ "bits": 4590000576850785362,+ "r4": 0.0741+ },+ {+ "bits": 4568287308967113770,+ "r4": 0.0027+ },+ {+ "bits": 4581430736683295138,+ "r4": 0.02+ },+ {+ "bits": 4583491152160744988,+ "r4": 0.0272+ },+ {+ "bits": 4576033101341643337,+ "r4": 0.0085+ },+ {+ "bits": 4598675554710702173,+ "r4": 0.2778+ },+ {+ "bits": 4593303215251882080,+ "r4": 0.1199+ },+ {+ "bits": 4582096639533010853,+ "r4": 0.0223+ },+ {+ "bits": 4589236723968825982,+ "r4": 0.0635+ },+ {+ "bits": 4571505503708907418,+ "r4": 0.0042+ },+ {+ "bits": 4585336925324632955,+ "r4": 0.0359+ },+ {+ "bits": 4604968359779124192,+ "r4": 0.7542+ },+ {+ "bits": 4565964539940926316,+ "r4": 0.0018+ },+ {+ "bits": 4593030123685309281,+ "r4": 0.1161+ },+ {+ "bits": 4578376400392779601,+ "r4": 0.0125+ },+ {+ "bits": 4588605002984719723,+ "r4": 0.0586+ },+ {+ "bits": 4576966069242970126,+ "r4": 0.0101+ },+ {+ "bits": 4581372518498292939,+ "r4": 0.0198+ },+ {+ "bits": 4585728976133897517,+ "r4": 0.0386+ },+ {+ "bits": 4603226038123859156,+ "r4": 0.5608+ },+ {+ "bits": 4589255270692969239,+ "r4": 0.0637+ },+ {+ "bits": 4569540803080739095,+ "r4": 0.0032+ },+ {+ "bits": 4551903620657896630,+ "r4": 0.0002+ },+ {+ "bits": 4575860045686037130,+ "r4": 0.0082+ },+ {+ "bits": 4574995743384517116,+ "r4": 0.0072+ },+ {+ "bits": 4591808326279448964,+ "r4": 0.0991+ },+ {+ "bits": 4583332937998847946,+ "r4": 0.0266+ },+ {+ "bits": 4562769255596862922,+ "r4": 0.0011+ },+ {+ "bits": 4576394452746648106,+ "r4": 0.0091+ },+ {+ "bits": 4583735276673540012,+ "r4": 0.028+ },+ {+ "bits": 4596994679760229277,+ "r4": 0.2172+ },+ {+ "bits": 4558834075326285043,+ "r4": 0.0006+ },+ {+ "bits": 4586707544071714991,+ "r4": 0.0454+ },+ {+ "bits": 4581581380226337549,+ "r4": 0.0206+ },+ {+ "bits": 4592169843964599355,+ "r4": 0.1042+ },+ {+ "bits": 4573403535350228272,+ "r4": 0.0059+ },+ {+ "bits": 4596831789032230601,+ "r4": 0.2127+ },+ {+ "bits": 4551766175702299318,+ "r4": 0.0002+ },+ {+ "bits": 4598789917543713252,+ "r4": 0.2841+ },+ {+ "bits": 4564055604308549746,+ "r4": 0.0014+ },+ {+ "bits": 4557722993533415915,+ "r4": 0.0005+ },+ {+ "bits": 4584765647213444971,+ "r4": 0.032+ },+ {+ "bits": 4577154867221571886,+ "r4": 0.0104+ },+ {+ "bits": 4558426901227842486,+ "r4": 0.0006+ },+ {+ "bits": 4572938836346827981,+ "r4": 0.0055+ },+ {+ "bits": 4586181524360957066,+ "r4": 0.0418+ },+ {+ "bits": 4595104855566268955,+ "r4": 0.1648+ },+ {+ "bits": 4582396648944169050,+ "r4": 0.0234+ },+ {+ "bits": 4596044080028048520,+ "r4": 0.1908+ },+ {+ "bits": 4568916355618219107,+ "r4": 0.0029+ },+ {+ "bits": 4587909538547078204,+ "r4": 0.0538+ },+ {+ "bits": 4581047708673353647,+ "r4": 0.0187+ },+ {+ "bits": 4577302366997208766,+ "r4": 0.0107+ },+ {+ "bits": 4573101579420675586,+ "r4": 0.0056+ },+ {+ "bits": 4580560102638151081,+ "r4": 0.017+ },+ {+ "bits": 4572375063166157570,+ "r4": 0.005+ },+ {+ "bits": 4585040204504111578,+ "r4": 0.0339+ },+ {+ "bits": 4568955506582180135,+ "r4": 0.003+ },+ {+ "bits": 4581148779537461522,+ "r4": 0.0191+ },+ {+ "bits": 4599105543748194571,+ "r4": 0.3016+ },+ {+ "bits": 4591745031448668060,+ "r4": 0.0983+ },+ {+ "bits": 4570839910880753571,+ "r4": 0.0038+ },+ {+ "bits": 4596024183212748948,+ "r4": 0.1903+ },+ {+ "bits": 4575849782681641860,+ "r4": 0.0081+ },+ {+ "bits": 4593825067176598746,+ "r4": 0.1293+ },+ {+ "bits": 4594590988641898098,+ "r4": 0.1505+ },+ {+ "bits": 4574559494127442827,+ "r4": 0.0069+ },+ {+ "bits": 4578586620010584641,+ "r4": 0.0129+ },+ {+ "bits": 4588350826126369720,+ "r4": 0.0568+ },+ {+ "bits": 4560584547723187909,+ "r4": 0.0008+ },+ {+ "bits": 4566066605046584858,+ "r4": 0.0018+ },+ {+ "bits": 4574144965199247372,+ "r4": 0.0065+ },+ {+ "bits": 4578138410021732416,+ "r4": 0.0121+ },+ {+ "bits": 4591192189549249629,+ "r4": 0.0906+ },+ {+ "bits": 4594082648980353778,+ "r4": 0.1364+ },+ {+ "bits": 4564285174373118610,+ "r4": 0.0014+ },+ {+ "bits": 4567413622504469926,+ "r4": 0.0023+ },+ {+ "bits": 4569907511042239615,+ "r4": 0.0034+ },+ {+ "bits": 4593849363595673850,+ "r4": 0.1299+ },+ {+ "bits": 4588796409009286579,+ "r4": 0.0599+ },+ {+ "bits": 4557820380436162212,+ "r4": 0.0005+ },+ {+ "bits": 4572699578967328524,+ "r4": 0.0052+ },+ {+ "bits": 4576235538996179643,+ "r4": 0.0088+ },+ {+ "bits": 4605488330699615480,+ "r4": 0.8119+ },+ {+ "bits": 4558591861871495973,+ "r4": 0.0006+ },+ {+ "bits": 4588904321762734676,+ "r4": 0.0607+ },+ {+ "bits": 4574495897216609527,+ "r4": 0.0068+ },+ {+ "bits": 4555124311703980649,+ "r4": 0.0004+ },+ {+ "bits": 4586001223451095349,+ "r4": 0.0405+ },+ {+ "bits": 4572720214226934281,+ "r4": 0.0053+ },+ {+ "bits": 4560065025252663683,+ "r4": 0.0008+ },+ {+ "bits": 4553947171652106932,+ "r4": 0.0003+ },+ {+ "bits": 4569662381160154025,+ "r4": 0.0033+ },+ {+ "bits": 4567732257469504570,+ "r4": 0.0024+ },+ {+ "bits": 4586140083713750889,+ "r4": 0.0415+ },+ {+ "bits": 4577547437105474375,+ "r4": 0.0111+ },+ {+ "bits": 4585837019721467958,+ "r4": 0.0394+ },+ {+ "bits": 4580747862331018152,+ "r4": 0.0177+ },+ {+ "bits": 4598309219167463106,+ "r4": 0.2574+ },+ {+ "bits": 4584664447335384403,+ "r4": 0.0313+ },+ {+ "bits": 4569404232952552518,+ "r4": 0.0031+ },+ {+ "bits": 4592949491619566771,+ "r4": 0.115+ },+ {+ "bits": 4596963576237839185,+ "r4": 0.2164+ },+ {+ "bits": 4596912115433073146,+ "r4": 0.2149+ },+ {+ "bits": 4592217865267679009,+ "r4": 0.1048+ },+ {+ "bits": 4588489674130365626,+ "r4": 0.0578+ },+ {+ "bits": 4596828215936480660,+ "r4": 0.2126+ },+ {+ "bits": 4568198686860376647,+ "r4": 0.0026+ },+ {+ "bits": 4594718732189734497,+ "r4": 0.1541+ },+ {+ "bits": 4577148031741035370,+ "r4": 0.0104+ },+ {+ "bits": 4588461121683984706,+ "r4": 0.0576+ },+ {+ "bits": 4576833384449956802,+ "r4": 0.0099+ },+ {+ "bits": 4570015950906625126,+ "r4": 0.0034+ },+ {+ "bits": 4575837938915518670,+ "r4": 0.0081+ },+ {+ "bits": 4593066902051068117,+ "r4": 0.1166+ },+ {+ "bits": 4589378734220280037,+ "r4": 0.0654+ },+ {+ "bits": 4585383841306464885,+ "r4": 0.0362+ },+ {+ "bits": 4582915354790740452,+ "r4": 0.0252+ },+ {+ "bits": 4566406225061938708,+ "r4": 0.0019+ },+ {+ "bits": 4558933664520287470,+ "r4": 0.0006+ },+ {+ "bits": 4589939703982077735,+ "r4": 0.0732+ },+ {+ "bits": 4593952252131300092,+ "r4": 0.1328+ },+ {+ "bits": 4580677846986357186,+ "r4": 0.0174+ },+ {+ "bits": 4579292788033893172,+ "r4": 0.0141+ },+ {+ "bits": 4585028225030550591,+ "r4": 0.0338+ },+ {+ "bits": 4606878206050345148,+ "r4": 0.9662+ },+ {+ "bits": 4573998236522481801,+ "r4": 0.0064+ },+ {+ "bits": 4566923941064401093,+ "r4": 0.0021+ },+ {+ "bits": 4583187066815202479,+ "r4": 0.0261+ },+ {+ "bits": 4595079839312219595,+ "r4": 0.1641+ },+ {+ "bits": 4576807831901686570,+ "r4": 0.0098+ },+ {+ "bits": 4587459672253678377,+ "r4": 0.0506+ },+ {+ "bits": 4568276893928089596,+ "r4": 0.0027+ },+ {+ "bits": 4567386802702220821,+ "r4": 0.0023+ },+ {+ "bits": 4599882663620879821,+ "r4": 0.3448+ },+ {+ "bits": 4574379688275391685,+ "r4": 0.0067+ },+ {+ "bits": 4544142797714711474,+ "r4": 0.0001+ },+ {+ "bits": 4565236078241694311,+ "r4": 0.0016+ },+ {+ "bits": 4586611027887919820,+ "r4": 0.0448+ },+ {+ "bits": 4593398881168629794,+ "r4": 0.1212+ },+ {+ "bits": 4563187248528710316,+ "r4": 0.0012+ },+ {+ "bits": 4588146367647923312,+ "r4": 0.0554+ },+ {+ "bits": 4590099483289312027,+ "r4": 0.0754+ },+ {+ "bits": 4564036274786193152,+ "r4": 0.0014+ },+ {+ "bits": 4590671552140965025,+ "r4": 0.0834+ },+ {+ "bits": 4562648299032324638,+ "r4": 0.0011+ },+ {+ "bits": 4578205308584140454,+ "r4": 0.0122+ },+ {+ "bits": 4585473201978023066,+ "r4": 0.0369+ },+ {+ "bits": 4597941445054772921,+ "r4": 0.2435+ },+ {+ "bits": 4596988424073366326,+ "r4": 0.2171+ },+ {+ "bits": 4584835981128135600,+ "r4": 0.0324+ },+ {+ "bits": 4594464854815402431,+ "r4": 0.147+ },+ {+ "bits": 4562811609679131473,+ "r4": 0.0011+ },+ {+ "bits": 4596983979759622710,+ "r4": 0.2169+ },+ {+ "bits": 4588050367779508683,+ "r4": 0.0547+ },+ {+ "bits": 4565835234055489850,+ "r4": 0.0018+ },+ {+ "bits": 4575941501560119325,+ "r4": 0.0083+ },+ {+ "bits": 4580961162897626970,+ "r4": 0.0184+ },+ {+ "bits": 4576056778495653666,+ "r4": 0.0085+ },+ {+ "bits": 4575531234495111736,+ "r4": 0.0077+ },+ {+ "bits": 4587427069010784025,+ "r4": 0.0504+ },+ {+ "bits": 4589533874764903926,+ "r4": 0.0676+ },+ {+ "bits": 4598386007576506277,+ "r4": 0.2617+ },+ {+ "bits": 4598280159292736023,+ "r4": 0.2558+ },+ {+ "bits": 4599400364671023654,+ "r4": 0.318+ },+ {+ "bits": 4575639113780249726,+ "r4": 0.0078+ },+ {+ "bits": 4564388916914609479,+ "r4": 0.0015+ },+ {+ "bits": 4582575514354681314,+ "r4": 0.024+ },+ {+ "bits": 4572993283736762827,+ "r4": 0.0055+ },+ {+ "bits": 4587566317321547663,+ "r4": 0.0514+ },+ {+ "bits": 4580445274326439206,+ "r4": 0.0166+ },+ {+ "bits": 4595583997100002717,+ "r4": 0.1781+ },+ {+ "bits": 4578552808259450976,+ "r4": 0.0128+ },+ {+ "bits": 4588236110340181692,+ "r4": 0.056+ },+ {+ "bits": 4583626685051955674,+ "r4": 0.0276+ },+ {+ "bits": 4584282972955438412,+ "r4": 0.0299+ },+ {+ "bits": 4603827036081149297,+ "r4": 0.6275+ },+ {+ "bits": 4581627417454075914,+ "r4": 0.0207+ },+ {+ "bits": 4578983125797617781,+ "r4": 0.0136+ },+ {+ "bits": 4568790203413352084,+ "r4": 0.0029+ },+ {+ "bits": 4601125514467246214,+ "r4": 0.4138+ },+ {+ "bits": 4596535227961228119,+ "r4": 0.2045+ },+ {+ "bits": 4576955587670750747,+ "r4": 0.0101+ },+ {+ "bits": 4597741004964576630,+ "r4": 0.2379+ },+ {+ "bits": 4591419950719874671,+ "r4": 0.0938+ },+ {+ "bits": 4568610428669465439,+ "r4": 0.0028+ },+ {+ "bits": 4606875239963666877,+ "r4": 0.9659+ },+ {+ "bits": 4585075682417402939,+ "r4": 0.0341+ },+ {+ "bits": 4598838817021821901,+ "r4": 0.2868+ },+ {+ "bits": 4581579781910343029,+ "r4": 0.0205+ },+ {+ "bits": 4568212689109626442,+ "r4": 0.0026+ },+ {+ "bits": 4588895171269669579,+ "r4": 0.0606+ },+ {+ "bits": 4575892618325229721,+ "r4": 0.0082+ },+ {+ "bits": 4595020654368398380,+ "r4": 0.1624+ },+ {+ "bits": 4601935064124248459,+ "r4": 0.4587+ },+ {+ "bits": 4600169079885230733,+ "r4": 0.3607+ },+ {+ "bits": 4579084125918193375,+ "r4": 0.0138+ },+ {+ "bits": 4603809774689212190,+ "r4": 0.6256+ },+ {+ "bits": 4599301116874651080,+ "r4": 0.3125+ },+ {+ "bits": 4585097230891836521,+ "r4": 0.0343+ },+ {+ "bits": 4603068299586505876,+ "r4": 0.5432+ },+ {+ "bits": 4592591181616255493,+ "r4": 0.11+ },+ {+ "bits": 4572439471582697800,+ "r4": 0.005+ },+ {+ "bits": 4544947441519899504,+ "r4": 0.0001+ },+ {+ "bits": 4567926000417386321,+ "r4": 0.0025+ },+ {+ "bits": 4588037933191271924,+ "r4": 0.0547+ },+ {+ "bits": 4563582848265143262,+ "r4": 0.0013+ },+ {+ "bits": 4569249906529160845,+ "r4": 0.0031+ },+ {+ "bits": 4567963741182098727,+ "r4": 0.0025+ },+ {+ "bits": 4580174024514311508,+ "r4": 0.0157+ },+ {+ "bits": 4569333321333160536,+ "r4": 0.0031+ },+ {+ "bits": 4590698128038272678,+ "r4": 0.0837+ },+ {+ "bits": 4571022597340583290,+ "r4": 0.0038+ },+ {+ "bits": 4605509065215580023,+ "r4": 0.8142+ },+ {+ "bits": 4567005975177601764,+ "r4": 0.0021+ },+ {+ "bits": 4571456976170038066,+ "r4": 0.0042+ },+ {+ "bits": 4571239830451932256,+ "r4": 0.004+ },+ {+ "bits": 4558572162318468616,+ "r4": 0.0006+ },+ {+ "bits": 4590274722043760150,+ "r4": 0.0779+ },+ {+ "bits": 4589652459128245851,+ "r4": 0.0692+ },+ {+ "bits": 4594222149695836254,+ "r4": 0.1403+ },+ {+ "bits": 4578391756054601242,+ "r4": 0.0126+ },+ {+ "bits": 4595210024716126467,+ "r4": 0.1677+ },+ {+ "bits": 4590669916632504435,+ "r4": 0.0833+ },+ {+ "bits": 4591967917465952815,+ "r4": 0.1014+ },+ {+ "bits": 4570384265758267981,+ "r4": 0.0036+ },+ {+ "bits": 4559516644540652914,+ "r4": 0.0007+ },+ {+ "bits": 4599718591321208701,+ "r4": 0.3357+ },+ {+ "bits": 4574900267273184627,+ "r4": 0.0072+ },+ {+ "bits": 4585257777864418899,+ "r4": 0.0354+ },+ {+ "bits": 4594820908046549678,+ "r4": 0.1569+ },+ {+ "bits": 4569943410114707851,+ "r4": 0.0034+ },+ {+ "bits": 4598136870931648699,+ "r4": 0.2489+ },+ {+ "bits": 4602144314883522873,+ "r4": 0.4703+ },+ {+ "bits": 4587315929742886797,+ "r4": 0.0496+ },+ {+ "bits": 4572440979424573573,+ "r4": 0.005+ },+ {+ "bits": 4575933529149549088,+ "r4": 0.0083+ },+ {+ "bits": 4570538146123002238,+ "r4": 0.0036+ },+ {+ "bits": 4577925338495702241,+ "r4": 0.0117+ },+ {+ "bits": 4574418334937507133,+ "r4": 0.0067+ },+ {+ "bits": 4585857291474460753,+ "r4": 0.0395+ },+ {+ "bits": 4600650798398678708,+ "r4": 0.3874+ },+ {+ "bits": 4574633815447606915,+ "r4": 0.0069+ },+ {+ "bits": 4595598811616155171,+ "r4": 0.1785+ },+ {+ "bits": 4600654638708754389,+ "r4": 0.3876+ },+ {+ "bits": 4584349167826610929,+ "r4": 0.0302+ },+ {+ "bits": 4590186151136412472,+ "r4": 0.0766+ },+ {+ "bits": 4602958513839672536,+ "r4": 0.5311+ },+ {+ "bits": 4577446366616892913,+ "r4": 0.0109+ },+ {+ "bits": 4580349449781297685,+ "r4": 0.0163+ },+ {+ "bits": 4595481072799340959,+ "r4": 0.1752+ },+ {+ "bits": 4594923403985363045,+ "r4": 0.1597+ },+ {+ "bits": 4575791580709685205,+ "r4": 0.008+ },+ {+ "bits": 4574364970912447938,+ "r4": 0.0067+ },+ {+ "bits": 4560101933199801466,+ "r4": 0.0008+ },+ {+ "bits": 4574946564186908039,+ "r4": 0.0072+ },+ {+ "bits": 4585866235261290851,+ "r4": 0.0396+ },+ {+ "bits": 4585218040923104140,+ "r4": 0.0351+ },+ {+ "bits": 4573315051152878621,+ "r4": 0.0058+ },+ {+ "bits": 4571148966538190755,+ "r4": 0.0039+ },+ {+ "bits": 4559780093354900820,+ "r4": 0.0007+ },+ {+ "bits": 4569375607834924807,+ "r4": 0.0031+ },+ {+ "bits": 4575598874027832770,+ "r4": 0.0078+ },+ {+ "bits": 4566032945540625613,+ "r4": 0.0018+ },+ {+ "bits": 4575428674564488767,+ "r4": 0.0076+ },+ {+ "bits": 4588366311249693299,+ "r4": 0.0569+ },+ {+ "bits": 4576114760237205951,+ "r4": 0.0086+ },+ {+ "bits": 4589919826830700213,+ "r4": 0.0729+ },+ {+ "bits": 4604018248317085783,+ "r4": 0.6487+ },+ {+ "bits": 4575910694029308537,+ "r4": 0.0083+ },+ {+ "bits": 4590173928310459438,+ "r4": 0.0765+ },+ {+ "bits": 4575228268512269177,+ "r4": 0.0074+ },+ {+ "bits": 4580094472637761598,+ "r4": 0.0155+ },+ {+ "bits": 4562659153866619033,+ "r4": 0.0011+ },+ {+ "bits": 4567541229444763463,+ "r4": 0.0023+ },+ {+ "bits": 4568822948175084807,+ "r4": 0.0029+ },+ {+ "bits": 4585884838565355766,+ "r4": 0.0397+ },+ {+ "bits": 4555977173938819360,+ "r4": 0.0004+ },+ {+ "bits": 4585764088610693820,+ "r4": 0.0389+ },+ {+ "bits": 4570723816920472754,+ "r4": 0.0037+ },+ {+ "bits": 4605731759221454619,+ "r4": 0.8389+ },+ {+ "bits": 4587231934039834913,+ "r4": 0.0491+ },+ {+ "bits": 4602321388802985905,+ "r4": 0.4802+ },+ {+ "bits": 4584737818581203651,+ "r4": 0.0318+ },+ {+ "bits": 4589793011314236442,+ "r4": 0.0712+ },+ {+ "bits": 4584352032076529730,+ "r4": 0.0302+ },+ {+ "bits": 4595726701270945665,+ "r4": 0.182+ },+ {+ "bits": 4596543202513527891,+ "r4": 0.2047+ },+ {+ "bits": 4601860406178204142,+ "r4": 0.4546+ },+ {+ "bits": 4582417054317110313,+ "r4": 0.0235+ },+ {+ "bits": 4556087148220077504,+ "r4": 0.0004+ },+ {+ "bits": 4554381361024768511,+ "r4": 0.0003+ },+ {+ "bits": 4593479179018305690,+ "r4": 0.1223+ },+ {+ "bits": 4571650520054675886,+ "r4": 0.0043+ },+ {+ "bits": 4581461198010524361,+ "r4": 0.0201+ },+ {+ "bits": 4573479625655013618,+ "r4": 0.0059+ },+ {+ "bits": 4569283106941959522,+ "r4": 0.0031+ },+ {+ "bits": 4588532163062265690,+ "r4": 0.0581+ },+ {+ "bits": 4567893140255817535,+ "r4": 0.0025+ },+ {+ "bits": 4590833936432635361,+ "r4": 0.0856+ },+ {+ "bits": 4556874952155391186,+ "r4": 0.0004+ },+ {+ "bits": 4572269872104989566,+ "r4": 0.0049+ },+ {+ "bits": 4566315065363680810,+ "r4": 0.0019+ },+ {+ "bits": 4592836909290889529,+ "r4": 0.1134+ },+ {+ "bits": 4579312103045600117,+ "r4": 0.0142+ },+ {+ "bits": 4590632137023540605,+ "r4": 0.0828+ },+ {+ "bits": 4561988228472905084,+ "r4": 0.001+ },+ {+ "bits": 4559530869380224856,+ "r4": 0.0007+ },+ {+ "bits": 4595355038883459893,+ "r4": 0.1717+ },+ {+ "bits": 4584568929470789334,+ "r4": 0.0309+ },+ {+ "bits": 4573642237837715898,+ "r4": 0.0061+ },+ {+ "bits": 4604036341211594846,+ "r4": 0.6507+ },+ {+ "bits": 4575110260840881695,+ "r4": 0.0073+ },+ {+ "bits": 4593968459344404534,+ "r4": 0.1332+ },+ {+ "bits": 4596704230794324299,+ "r4": 0.2092+ },+ {+ "bits": 4572164338059173603,+ "r4": 0.0048+ },+ {+ "bits": 4578968397159155921,+ "r4": 0.0136+ },+ {+ "bits": 4584963639754572978,+ "r4": 0.0333+ },+ {+ "bits": 4591537779356050468,+ "r4": 0.0954+ },+ {+ "bits": 4586683586864761337,+ "r4": 0.0453+ },+ {+ "bits": 4580803895128699891,+ "r4": 0.0179+ },+ {+ "bits": 4581014439923215498,+ "r4": 0.0186+ },+ {+ "bits": 4558162147933628992,+ "r4": 0.0005+ },+ {+ "bits": 4595329014932886712,+ "r4": 0.171+ },+ {+ "bits": 4559445590051441947,+ "r4": 0.0007+ },+ {+ "bits": 4588576317005841957,+ "r4": 0.0584+ },+ {+ "bits": 4590227142591613999,+ "r4": 0.0772+ },+ {+ "bits": 4583459496145733337,+ "r4": 0.0271+ },+ {+ "bits": 4585648241599117029,+ "r4": 0.0381+ },+ {+ "bits": 4562234759304070293,+ "r4": 0.001+ },+ {+ "bits": 4593474855405475890,+ "r4": 0.1223+ },+ {+ "bits": 4585402261944532674,+ "r4": 0.0364+ },+ {+ "bits": 4584150840936042857,+ "r4": 0.0295+ },+ {+ "bits": 4566883551070924874,+ "r4": 0.0021+ },+ {+ "bits": 4570097021628975706,+ "r4": 0.0034+ },+ {+ "bits": 4586517349964512260,+ "r4": 0.0441+ },+ {+ "bits": 4576768099929435170,+ "r4": 0.0097+ },+ {+ "bits": 4592058884277722033,+ "r4": 0.1026+ },+ {+ "bits": 4581898696675567720,+ "r4": 0.0217+ },+ {+ "bits": 4600393023706423382,+ "r4": 0.3731+ },+ {+ "bits": 4583747223858041702,+ "r4": 0.0281+ },+ {+ "bits": 4600596603119631463,+ "r4": 0.3844+ },+ {+ "bits": 4580492585069335833,+ "r4": 0.0168+ },+ {+ "bits": 4568556846057247071,+ "r4": 0.0028+ },+ {+ "bits": 4577625467067091448,+ "r4": 0.0112+ },+ {+ "bits": 4579069380843873475,+ "r4": 0.0137+ },+ {+ "bits": 4570748015633756046,+ "r4": 0.0037+ },+ {+ "bits": 4566739785802723428,+ "r4": 0.002+ },+ {+ "bits": 4548099488656802635,+ "r4": 0.0001+ },+ {+ "bits": 4583206571949707756,+ "r4": 0.0262+ },+ {+ "bits": 4606770240996408972,+ "r4": 0.9542+ },+ {+ "bits": 4583013722312392559,+ "r4": 0.0255+ },+ {+ "bits": 4584089869390931882,+ "r4": 0.0293+ },+ {+ "bits": 4572395191860558537,+ "r4": 0.005+ },+ {+ "bits": 4582160034367306209,+ "r4": 0.0226+ },+ {+ "bits": 4576380278537501028,+ "r4": 0.0091+ },+ {+ "bits": 4575511953298742726,+ "r4": 0.0077+ },+ {+ "bits": 4602403606035855985,+ "r4": 0.4847+ },+ {+ "bits": 4580849961597502752,+ "r4": 0.018+ },+ {+ "bits": 4592406283076136478,+ "r4": 0.1074+ },+ {+ "bits": 4594386939274816079,+ "r4": 0.1449+ },+ {+ "bits": 4571938933230083208,+ "r4": 0.0046+ },+ {+ "bits": 4594258990708489658,+ "r4": 0.1413+ },+ {+ "bits": 4593974497914330487,+ "r4": 0.1334+ },+ {+ "bits": 4580733825421089824,+ "r4": 0.0176+ },+ {+ "bits": 4595111388622783832,+ "r4": 0.165+ },+ {+ "bits": 4556150056311998586,+ "r4": 0.0004+ },+ {+ "bits": 4589520592526509112,+ "r4": 0.0674+ },+ {+ "bits": 4585366237511834365,+ "r4": 0.0361+ },+ {+ "bits": 4579219220788441931,+ "r4": 0.014+ },+ {+ "bits": 4573747677441169981,+ "r4": 0.0062+ },+ {+ "bits": 4588781784185021541,+ "r4": 0.0598+ },+ {+ "bits": 4601243852494952171,+ "r4": 0.4203+ },+ {+ "bits": 4590413723217676656,+ "r4": 0.0798+ },+ {+ "bits": 4589921815659129341,+ "r4": 0.073+ },+ {+ "bits": 4587208221338273408,+ "r4": 0.0489+ },+ {+ "bits": 4582087365707701530,+ "r4": 0.0223+ },+ {+ "bits": 4584990492233529272,+ "r4": 0.0335+ },+ {+ "bits": 4544060584077456251,+ "r4": 0.0001+ },+ {+ "bits": 4575193697493541603,+ "r4": 0.0074+ },+ {+ "bits": 4557946232742908865,+ "r4": 0.0005+ },+ {+ "bits": 4574194468151731487,+ "r4": 0.0065+ },+ {+ "bits": 4605251318792977113,+ "r4": 0.7856+ },+ {+ "bits": 4575873972669556503,+ "r4": 0.0082+ },+ {+ "bits": 4564388609683866791,+ "r4": 0.0015+ },+ {+ "bits": 4577594169532774616,+ "r4": 0.0112+ },+ {+ "bits": 4553392680167696723,+ "r4": 0.0003+ },+ {+ "bits": 4562686677363071636,+ "r4": 0.0011+ },+ {+ "bits": 4593741649739487625,+ "r4": 0.1269+ },+ {+ "bits": 4582239061287271997,+ "r4": 0.0228+ },+ {+ "bits": 4592023806571665391,+ "r4": 0.1021+ },+ {+ "bits": 4558599158407577651,+ "r4": 0.0006+ },+ {+ "bits": 4596208600520123594,+ "r4": 0.1954+ },+ {+ "bits": 4584799780524558833,+ "r4": 0.0322+ },+ {+ "bits": 4599665367345167034,+ "r4": 0.3327+ },+ {+ "bits": 4585852934654904564,+ "r4": 0.0395+ },+ {+ "bits": 4594488593688736894,+ "r4": 0.1477+ },+ {+ "bits": 4586525757802488815,+ "r4": 0.0442+ },+ {+ "bits": 4584179195744289983,+ "r4": 0.0296+ },+ {+ "bits": 4585159223983697887,+ "r4": 0.0347+ },+ {+ "bits": 4605398008074457065,+ "r4": 0.8019+ },+ {+ "bits": 4571966024878164170,+ "r4": 0.0046+ },+ {+ "bits": 4590563813974622088,+ "r4": 0.0819+ },+ {+ "bits": 4569553746733675093,+ "r4": 0.0032+ },+ {+ "bits": 4589464896254457490,+ "r4": 0.0666+ },+ {+ "bits": 4568688618382583568,+ "r4": 0.0028+ },+ {+ "bits": 4572631569923023216,+ "r4": 0.0052+ },+ {+ "bits": 4572775316462835747,+ "r4": 0.0053+ },+ {+ "bits": 4585368961949172562,+ "r4": 0.0361+ },+ {+ "bits": 4581542435336672038,+ "r4": 0.0204+ },+ {+ "bits": 4575063346264305512,+ "r4": 0.0073+ },+ {+ "bits": 4590805277574006701,+ "r4": 0.0852+ },+ {+ "bits": 4603533265851050341,+ "r4": 0.5949+ },+ {+ "bits": 4595512801862296878,+ "r4": 0.1761+ },+ {+ "bits": 4602276201001592922,+ "r4": 0.4777+ },+ {+ "bits": 4576418394245081395,+ "r4": 0.0091+ },+ {+ "bits": 4581996993627805400,+ "r4": 0.022+ },+ {+ "bits": 4581658715821935985,+ "r4": 0.0208+ },+ {+ "bits": 4580434666395884341,+ "r4": 0.0166+ },+ {+ "bits": 4577211641748646999,+ "r4": 0.0105+ },+ {+ "bits": 4601657680603940608,+ "r4": 0.4433+ },+ {+ "bits": 4583662979804066717,+ "r4": 0.0278+ },+ {+ "bits": 4589650938062670873,+ "r4": 0.0692+ },+ {+ "bits": 4567445867895167619,+ "r4": 0.0023+ },+ {+ "bits": 4590254245083842861,+ "r4": 0.0776+ },+ {+ "bits": 4576161060703330050,+ "r4": 0.0087+ },+ {+ "bits": 4569173185007877602,+ "r4": 0.003+ },+ {+ "bits": 4585817095166211567,+ "r4": 0.0392+ },+ {+ "bits": 4563863118793932519,+ "r4": 0.0013+ },+ {+ "bits": 4586418300029103309,+ "r4": 0.0434+ },+ {+ "bits": 4586573272733848603,+ "r4": 0.0445+ },+ {+ "bits": 4600916339106620719,+ "r4": 0.4022+ },+ {+ "bits": 4589054888646486789,+ "r4": 0.0617+ },+ {+ "bits": 4586280451472255764,+ "r4": 0.0425+ },+ {+ "bits": 4584019587196431647,+ "r4": 0.029+ },+ {+ "bits": 4554202055622080297,+ "r4": 0.0003+ },+ {+ "bits": 4566804668389450416,+ "r4": 0.002+ },+ {+ "bits": 4558175640528190638,+ "r4": 0.0005+ },+ {+ "bits": 4587319585453869549,+ "r4": 0.0497+ },+ {+ "bits": 4572522532252948713,+ "r4": 0.0051+ },+ {+ "bits": 4591143422503505136,+ "r4": 0.0899+ },+ {+ "bits": 4603124577953112525,+ "r4": 0.5495+ },+ {+ "bits": 4601787301611715684,+ "r4": 0.4505+ },+ {+ "bits": 4606561604690705230,+ "r4": 0.9311+ },+ {+ "bits": 4558785155834023651,+ "r4": 0.0006+ },+ {+ "bits": 4575266266310494228,+ "r4": 0.0075+ },+ {+ "bits": 4576708467701230264,+ "r4": 0.0096+ },+ {+ "bits": 4586920997193531409,+ "r4": 0.0469+ },+ {+ "bits": 4571601141316274414,+ "r4": 0.0043+ },+ {+ "bits": 4599695906816259285,+ "r4": 0.3344+ },+ {+ "bits": 4585536332378958122,+ "r4": 0.0373+ },+ {+ "bits": 4567736607777955341,+ "r4": 0.0024+ },+ {+ "bits": 4574553385899381710,+ "r4": 0.0069+ },+ {+ "bits": 4565154679436730197,+ "r4": 0.0016+ },+ {+ "bits": 4590085145484414525,+ "r4": 0.0752+ },+ {+ "bits": 4586994372644761253,+ "r4": 0.0474+ },+ {+ "bits": 4573617087503557790,+ "r4": 0.006+ },+ {+ "bits": 4560995493157431404,+ "r4": 0.0009+ },+ {+ "bits": 4567019643712161700,+ "r4": 0.0021+ },+ {+ "bits": 4588123049494827468,+ "r4": 0.0552+ },+ {+ "bits": 4571845460346638550,+ "r4": 0.0045+ },+ {+ "bits": 4585336028493845082,+ "r4": 0.0359+ },+ {+ "bits": 4558458516544981782,+ "r4": 0.0006+ },+ {+ "bits": 4579129157883273916,+ "r4": 0.0138+ },+ {+ "bits": 4589767910539415130,+ "r4": 0.0708+ },+ {+ "bits": 4595162387004090797,+ "r4": 0.1664+ },+ {+ "bits": 4581788513283673141,+ "r4": 0.0213+ },+ {+ "bits": 4593107499564582459,+ "r4": 0.1172+ },+ {+ "bits": 4575999154877683231,+ "r4": 0.0084+ },+ {+ "bits": 4573614923487952902,+ "r4": 0.006+ },+ {+ "bits": 4584987259455814971,+ "r4": 0.0335+ },+ {+ "bits": 4568877155529982846,+ "r4": 0.0029+ },+ {+ "bits": 4572168969949972129,+ "r4": 0.0048+ },+ {+ "bits": 4554567541130651343,+ "r4": 0.0003+ },+ {+ "bits": 4570621861356770138,+ "r4": 0.0037+ },+ {+ "bits": 4558326775415980381,+ "r4": 0.0006+ },+ {+ "bits": 4576156132855125075,+ "r4": 0.0087+ },+ {+ "bits": 4579319375720199346,+ "r4": 0.0142+ },+ {+ "bits": 4606434409210263998,+ "r4": 0.917+ },+ {+ "bits": 4594885059211007388,+ "r4": 0.1587+ },+ {+ "bits": 4605753159069899418,+ "r4": 0.8413+ }+ ],+ "halfway": [+ {+ "bits": 0,+ "r4": 0.0+ },+ {+ "bits": 4568256906500728737,+ "r4": 0.0027+ },+ {+ "bits": 4572760506128099233,+ "r4": 0.0053+ },+ {+ "bits": 4575736484761865657,+ "r4": 0.008+ },+ {+ "bits": 4577264105755469729,+ "r4": 0.0106+ },+ {+ "bits": 4578791726749073801,+ "r4": 0.0132+ },+ {+ "bits": 4580240084389236153,+ "r4": 0.0159+ },+ {+ "bits": 4581003894886038189,+ "r4": 0.0186+ },+ {+ "bits": 4581767705382840225,+ "r4": 0.0212+ },+ {+ "bits": 4582531515879642261,+ "r4": 0.0238+ },+ {+ "bits": 4583295326376444297,+ "r4": 0.0265+ },+ {+ "bits": 4584059136873246333,+ "r4": 0.0291+ },+ {+ "bits": 4584743684016606649,+ "r4": 0.0318+ },+ {+ "bits": 4585125589265007667,+ "r4": 0.0345+ },+ {+ "bits": 4585507494513408685,+ "r4": 0.0371+ },+ {+ "bits": 4585889399761809703,+ "r4": 0.0398+ },+ {+ "bits": 4586271305010210721,+ "r4": 0.0424+ },+ {+ "bits": 4586653210258611739,+ "r4": 0.045+ },+ {+ "bits": 4587035115507012757,+ "r4": 0.0477+ },+ {+ "bits": 4587417020755413775,+ "r4": 0.0503+ },+ {+ "bits": 4587798926003814793,+ "r4": 0.053+ },+ {+ "bits": 4588180831252215811,+ "r4": 0.0556+ },+ {+ "bits": 4588562736500616829,+ "r4": 0.0583+ },+ {+ "bits": 4588944641749017847,+ "r4": 0.0609+ },+ {+ "bits": 4589247283643977145,+ "r4": 0.0636+ },+ {+ "bits": 4589438236268177654,+ "r4": 0.0663+ },+ {+ "bits": 4589629188892378163,+ "r4": 0.0689+ },+ {+ "bits": 4589820141516578672,+ "r4": 0.0716+ },+ {+ "bits": 4590011094140779181,+ "r4": 0.0742+ },+ {+ "bits": 4590202046764979690,+ "r4": 0.0769+ },+ {+ "bits": 4590392999389180199,+ "r4": 0.0795+ },+ {+ "bits": 4590583952013380708,+ "r4": 0.0822+ },+ {+ "bits": 4590774904637581217,+ "r4": 0.0848+ },+ {+ "bits": 4590965857261781726,+ "r4": 0.0874+ },+ {+ "bits": 4591156809885982235,+ "r4": 0.0901+ },+ {+ "bits": 4591347762510182744,+ "r4": 0.0927+ },+ {+ "bits": 4591538715134383253,+ "r4": 0.0954+ },+ {+ "bits": 4591729667758583762,+ "r4": 0.098+ },+ {+ "bits": 4591920620382784271,+ "r4": 0.1007+ },+ {+ "bits": 4592111573006984780,+ "r4": 0.1033+ },+ {+ "bits": 4592302525631185289,+ "r4": 0.106+ },+ {+ "bits": 4592493478255385798,+ "r4": 0.1086+ },+ {+ "bits": 4592684430879586307,+ "r4": 0.1113+ },+ {+ "bits": 4592875383503786816,+ "r4": 0.1139+ },+ {+ "bits": 4593066336127987325,+ "r4": 0.1166+ },+ {+ "bits": 4593257288752187834,+ "r4": 0.1192+ },+ {+ "bits": 4593448241376388343,+ "r4": 0.1219+ },+ {+ "bits": 4593639194000588852,+ "r4": 0.1245+ },+ {+ "bits": 4593750883271347641,+ "r4": 0.1272+ },+ {+ "bits": 4593846359583447895,+ "r4": 0.1298+ },+ {+ "bits": 4593941835895548150,+ "r4": 0.1325+ },+ {+ "bits": 4594037312207648404,+ "r4": 0.1351+ },+ {+ "bits": 4594132788519748659,+ "r4": 0.1378+ },+ {+ "bits": 4594228264831848913,+ "r4": 0.1404+ },+ {+ "bits": 4594323741143949168,+ "r4": 0.1431+ },+ {+ "bits": 4594419217456049422,+ "r4": 0.1457+ },+ {+ "bits": 4594514693768149677,+ "r4": 0.1484+ },+ {+ "bits": 4594610170080249931,+ "r4": 0.151+ },+ {+ "bits": 4594705646392350186,+ "r4": 0.1537+ },+ {+ "bits": 4594801122704450440,+ "r4": 0.1563+ },+ {+ "bits": 4594896599016550695,+ "r4": 0.159+ },+ {+ "bits": 4594992075328650949,+ "r4": 0.1616+ },+ {+ "bits": 4595087551640751204,+ "r4": 0.1643+ },+ {+ "bits": 4595183027952851458,+ "r4": 0.1669+ },+ {+ "bits": 4595278504264951713,+ "r4": 0.1696+ },+ {+ "bits": 4595373980577051967,+ "r4": 0.1722+ },+ {+ "bits": 4595469456889152222,+ "r4": 0.1749+ },+ {+ "bits": 4595564933201252477,+ "r4": 0.1776+ },+ {+ "bits": 4595660409513352731,+ "r4": 0.1802+ },+ {+ "bits": 4595755885825452986,+ "r4": 0.1829+ },+ {+ "bits": 4595851362137553240,+ "r4": 0.1855+ },+ {+ "bits": 4595946838449653495,+ "r4": 0.1882+ },+ {+ "bits": 4596042314761753749,+ "r4": 0.1908+ },+ {+ "bits": 4596137791073854004,+ "r4": 0.1935+ },+ {+ "bits": 4596233267385954258,+ "r4": 0.1961+ },+ {+ "bits": 4596328743698054513,+ "r4": 0.1988+ },+ {+ "bits": 4596424220010154767,+ "r4": 0.2014+ },+ {+ "bits": 4596519696322255022,+ "r4": 0.2041+ },+ {+ "bits": 4596615172634355276,+ "r4": 0.2067+ },+ {+ "bits": 4596710648946455531,+ "r4": 0.2094+ },+ {+ "bits": 4596806125258555785,+ "r4": 0.212+ },+ {+ "bits": 4596901601570656040,+ "r4": 0.2147+ },+ {+ "bits": 4596997077882756294,+ "r4": 0.2173+ },+ {+ "bits": 4597092554194856549,+ "r4": 0.22+ },+ {+ "bits": 4597188030506956803,+ "r4": 0.2226+ },+ {+ "bits": 4597283506819057058,+ "r4": 0.2253+ },+ {+ "bits": 4597378983131157312,+ "r4": 0.2279+ },+ {+ "bits": 4597474459443257567,+ "r4": 0.2306+ },+ {+ "bits": 4597569935755357821,+ "r4": 0.2332+ },+ {+ "bits": 4597665412067458076,+ "r4": 0.2359+ },+ {+ "bits": 4597760888379558330,+ "r4": 0.2385+ },+ {+ "bits": 4597856364691658585,+ "r4": 0.2412+ },+ {+ "bits": 4597951841003758839,+ "r4": 0.2438+ },+ {+ "bits": 4598047317315859094,+ "r4": 0.2465+ },+ {+ "bits": 4598142793627959348,+ "r4": 0.2491+ },+ {+ "bits": 4598206744742668009,+ "r4": 0.2517+ },+ {+ "bits": 4598254482898718137,+ "r4": 0.2544+ },+ {+ "bits": 4598302221054768264,+ "r4": 0.2571+ },+ {+ "bits": 4598349959210818391,+ "r4": 0.2597+ },+ {+ "bits": 4598397697366868519,+ "r4": 0.2624+ },+ {+ "bits": 4598445435522918646,+ "r4": 0.265+ },+ {+ "bits": 4598493173678968773,+ "r4": 0.2676+ },+ {+ "bits": 4598540911835018900,+ "r4": 0.2703+ },+ {+ "bits": 4598588649991069028,+ "r4": 0.273+ },+ {+ "bits": 4598636388147119155,+ "r4": 0.2756+ },+ {+ "bits": 4598684126303169282,+ "r4": 0.2782+ },+ {+ "bits": 4598731864459219409,+ "r4": 0.2809+ },+ {+ "bits": 4598779602615269537,+ "r4": 0.2836+ },+ {+ "bits": 4598827340771319664,+ "r4": 0.2862+ },+ {+ "bits": 4598875078927369791,+ "r4": 0.2888+ },+ {+ "bits": 4598922817083419918,+ "r4": 0.2915+ },+ {+ "bits": 4598970555239470046,+ "r4": 0.2942+ },+ {+ "bits": 4599018293395520173,+ "r4": 0.2968+ },+ {+ "bits": 4599066031551570300,+ "r4": 0.2994+ },+ {+ "bits": 4599113769707620427,+ "r4": 0.3021+ },+ {+ "bits": 4599161507863670555,+ "r4": 0.3048+ },+ {+ "bits": 4599209246019720682,+ "r4": 0.3074+ },+ {+ "bits": 4599256984175770809,+ "r4": 0.31+ },+ {+ "bits": 4599304722331820936,+ "r4": 0.3127+ },+ {+ "bits": 4599352460487871064,+ "r4": 0.3154+ },+ {+ "bits": 4599400198643921191,+ "r4": 0.318+ },+ {+ "bits": 4599447936799971318,+ "r4": 0.3206+ },+ {+ "bits": 4599495674956021445,+ "r4": 0.3233+ },+ {+ "bits": 4599543413112071573,+ "r4": 0.326+ },+ {+ "bits": 4599591151268121700,+ "r4": 0.3286+ },+ {+ "bits": 4599638889424171827,+ "r4": 0.3312+ },+ {+ "bits": 4599686627580221954,+ "r4": 0.3339+ },+ {+ "bits": 4599734365736272082,+ "r4": 0.3366+ },+ {+ "bits": 4599782103892322209,+ "r4": 0.3392+ },+ {+ "bits": 4599829842048372336,+ "r4": 0.3418+ },+ {+ "bits": 4599877580204422463,+ "r4": 0.3445+ },+ {+ "bits": 4599925318360472591,+ "r4": 0.3472+ },+ {+ "bits": 4599973056516522718,+ "r4": 0.3498+ },+ {+ "bits": 4600020794672572845,+ "r4": 0.3524+ },+ {+ "bits": 4600068532828622973,+ "r4": 0.3551+ },+ {+ "bits": 4600116270984673100,+ "r4": 0.3578+ },+ {+ "bits": 4600164009140723227,+ "r4": 0.3604+ },+ {+ "bits": 4600211747296773354,+ "r4": 0.363+ },+ {+ "bits": 4600259485452823482,+ "r4": 0.3657+ },+ {+ "bits": 4600307223608873609,+ "r4": 0.3684+ },+ {+ "bits": 4600354961764923736,+ "r4": 0.371+ },+ {+ "bits": 4600402699920973863,+ "r4": 0.3736+ },+ {+ "bits": 4600450438077023991,+ "r4": 0.3763+ },+ {+ "bits": 4600498176233074118,+ "r4": 0.379+ },+ {+ "bits": 4600545914389124245,+ "r4": 0.3816+ },+ {+ "bits": 4600593652545174372,+ "r4": 0.3842+ },+ {+ "bits": 4600641390701224500,+ "r4": 0.3869+ },+ {+ "bits": 4600689128857274627,+ "r4": 0.3896+ },+ {+ "bits": 4600736867013324754,+ "r4": 0.3922+ },+ {+ "bits": 4600784605169374881,+ "r4": 0.3948+ },+ {+ "bits": 4600832343325425009,+ "r4": 0.3975+ },+ {+ "bits": 4600880081481475136,+ "r4": 0.4002+ },+ {+ "bits": 4600927819637525263,+ "r4": 0.4028+ },+ {+ "bits": 4600975557793575390,+ "r4": 0.4054+ },+ {+ "bits": 4601023295949625518,+ "r4": 0.4081+ },+ {+ "bits": 4601071034105675645,+ "r4": 0.4108+ },+ {+ "bits": 4601118772261725772,+ "r4": 0.4134+ },+ {+ "bits": 4601166510417775899,+ "r4": 0.416+ },+ {+ "bits": 4601214248573826027,+ "r4": 0.4187+ },+ {+ "bits": 4601261986729876154,+ "r4": 0.4214+ },+ {+ "bits": 4601309724885926281,+ "r4": 0.424+ },+ {+ "bits": 4601357463041976408,+ "r4": 0.4266+ },+ {+ "bits": 4601405201198026536,+ "r4": 0.4293+ },+ {+ "bits": 4601452939354076663,+ "r4": 0.432+ },+ {+ "bits": 4601500677510126790,+ "r4": 0.4346+ },+ {+ "bits": 4601548415666176918,+ "r4": 0.4373+ },+ {+ "bits": 4601596153822227045,+ "r4": 0.4399+ },+ {+ "bits": 4601643891978277172,+ "r4": 0.4425+ },+ {+ "bits": 4601691630134327299,+ "r4": 0.4452+ },+ {+ "bits": 4601739368290377427,+ "r4": 0.4479+ },+ {+ "bits": 4601787106446427554,+ "r4": 0.4505+ },+ {+ "bits": 4601834844602477681,+ "r4": 0.4531+ },+ {+ "bits": 4601882582758527808,+ "r4": 0.4558+ },+ {+ "bits": 4601930320914577936,+ "r4": 0.4585+ },+ {+ "bits": 4601978059070628063,+ "r4": 0.4611+ },+ {+ "bits": 4602025797226678190,+ "r4": 0.4637+ },+ {+ "bits": 4602073535382728317,+ "r4": 0.4664+ },+ {+ "bits": 4602121273538778445,+ "r4": 0.4691+ },+ {+ "bits": 4602169011694828572,+ "r4": 0.4717+ },+ {+ "bits": 4602216749850878699,+ "r4": 0.4743+ },+ {+ "bits": 4602264488006928826,+ "r4": 0.477+ },+ {+ "bits": 4602312226162978954,+ "r4": 0.4797+ },+ {+ "bits": 4602359964319029081,+ "r4": 0.4823+ },+ {+ "bits": 4602407702475079208,+ "r4": 0.4849+ },+ {+ "bits": 4602455440631129335,+ "r4": 0.4876+ },+ {+ "bits": 4602503178787179463,+ "r4": 0.4903+ },+ {+ "bits": 4602550916943229590,+ "r4": 0.4929+ },+ {+ "bits": 4602598655099279717,+ "r4": 0.4955+ },+ {+ "bits": 4602646393255329844,+ "r4": 0.4982+ },+ {+ "bits": 4602686475292013442,+ "r4": 0.5009+ },+ {+ "bits": 4602710344370038505,+ "r4": 0.5035+ },+ {+ "bits": 4602734213448063569,+ "r4": 0.5061+ },+ {+ "bits": 4602758082526088633,+ "r4": 0.5088+ },+ {+ "bits": 4602781951604113696,+ "r4": 0.5114+ },+ {+ "bits": 4602805820682138760,+ "r4": 0.5141+ },+ {+ "bits": 4602829689760163824,+ "r4": 0.5168+ },+ {+ "bits": 4602853558838188887,+ "r4": 0.5194+ },+ {+ "bits": 4602877427916213951,+ "r4": 0.5221+ },+ {+ "bits": 4602901296994239015,+ "r4": 0.5247+ },+ {+ "bits": 4602925166072264078,+ "r4": 0.5273+ },+ {+ "bits": 4602949035150289142,+ "r4": 0.53+ },+ {+ "bits": 4602972904228314205,+ "r4": 0.5326+ },+ {+ "bits": 4602996773306339269,+ "r4": 0.5353+ },+ {+ "bits": 4603020642384364333,+ "r4": 0.538+ },+ {+ "bits": 4603044511462389396,+ "r4": 0.5406+ },+ {+ "bits": 4603068380540414460,+ "r4": 0.5433+ },+ {+ "bits": 4603092249618439524,+ "r4": 0.5459+ },+ {+ "bits": 4603116118696464587,+ "r4": 0.5485+ },+ {+ "bits": 4603139987774489651,+ "r4": 0.5512+ },+ {+ "bits": 4603163856852514714,+ "r4": 0.5538+ },+ {+ "bits": 4603187725930539778,+ "r4": 0.5565+ },+ {+ "bits": 4603211595008564842,+ "r4": 0.5592+ },+ {+ "bits": 4603235464086589905,+ "r4": 0.5618+ },+ {+ "bits": 4603259333164614969,+ "r4": 0.5645+ },+ {+ "bits": 4603283202242640033,+ "r4": 0.5671+ },+ {+ "bits": 4603307071320665096,+ "r4": 0.5697+ },+ {+ "bits": 4603330940398690160,+ "r4": 0.5724+ },+ {+ "bits": 4603354809476715223,+ "r4": 0.575+ },+ {+ "bits": 4603378678554740287,+ "r4": 0.5777+ },+ {+ "bits": 4603402547632765351,+ "r4": 0.5804+ },+ {+ "bits": 4603426416710790414,+ "r4": 0.583+ },+ {+ "bits": 4603450285788815478,+ "r4": 0.5857+ },+ {+ "bits": 4603474154866840542,+ "r4": 0.5883+ },+ {+ "bits": 4603498023944865605,+ "r4": 0.5909+ },+ {+ "bits": 4603521893022890669,+ "r4": 0.5936+ },+ {+ "bits": 4603545762100915732,+ "r4": 0.5962+ },+ {+ "bits": 4603569631178940796,+ "r4": 0.5989+ },+ {+ "bits": 4603593500256965860,+ "r4": 0.6016+ },+ {+ "bits": 4603617369334990923,+ "r4": 0.6042+ },+ {+ "bits": 4603641238413015987,+ "r4": 0.6069+ },+ {+ "bits": 4603665107491041051,+ "r4": 0.6095+ },+ {+ "bits": 4603688976569066114,+ "r4": 0.6121+ },+ {+ "bits": 4603712845647091178,+ "r4": 0.6148+ },+ {+ "bits": 4603736714725116242,+ "r4": 0.6175+ },+ {+ "bits": 4603760583803141305,+ "r4": 0.6201+ },+ {+ "bits": 4603784452881166369,+ "r4": 0.6228+ },+ {+ "bits": 4603808321959191432,+ "r4": 0.6254+ },+ {+ "bits": 4603832191037216496,+ "r4": 0.628+ },+ {+ "bits": 4603856060115241560,+ "r4": 0.6307+ },+ {+ "bits": 4603879929193266623,+ "r4": 0.6333+ },+ {+ "bits": 4603903798271291687,+ "r4": 0.636+ },+ {+ "bits": 4603927667349316751,+ "r4": 0.6387+ },+ {+ "bits": 4603951536427341814,+ "r4": 0.6413+ },+ {+ "bits": 4603975405505366878,+ "r4": 0.644+ },+ {+ "bits": 4603999274583391941,+ "r4": 0.6466+ },+ {+ "bits": 4604023143661417005,+ "r4": 0.6492+ },+ {+ "bits": 4604047012739442069,+ "r4": 0.6519+ },+ {+ "bits": 4604070881817467132,+ "r4": 0.6545+ },+ {+ "bits": 4604094750895492196,+ "r4": 0.6572+ },+ {+ "bits": 4604118619973517260,+ "r4": 0.6599+ },+ {+ "bits": 4604142489051542323,+ "r4": 0.6625+ },+ {+ "bits": 4604166358129567387,+ "r4": 0.6652+ },+ {+ "bits": 4604190227207592450,+ "r4": 0.6678+ },+ {+ "bits": 4604214096285617514,+ "r4": 0.6704+ },+ {+ "bits": 4604237965363642578,+ "r4": 0.6731+ },+ {+ "bits": 4604261834441667641,+ "r4": 0.6757+ },+ {+ "bits": 4604285703519692705,+ "r4": 0.6784+ },+ {+ "bits": 4604309572597717769,+ "r4": 0.6811+ },+ {+ "bits": 4604333441675742832,+ "r4": 0.6837+ },+ {+ "bits": 4604357310753767896,+ "r4": 0.6864+ },+ {+ "bits": 4604381179831792959,+ "r4": 0.689+ },+ {+ "bits": 4604405048909818023,+ "r4": 0.6916+ },+ {+ "bits": 4604428917987843087,+ "r4": 0.6943+ },+ {+ "bits": 4604452787065868150,+ "r4": 0.6969+ },+ {+ "bits": 4604476656143893214,+ "r4": 0.6996+ },+ {+ "bits": 4604500525221918278,+ "r4": 0.7023+ },+ {+ "bits": 4604524394299943341,+ "r4": 0.7049+ },+ {+ "bits": 4604548263377968405,+ "r4": 0.7076+ },+ {+ "bits": 4604572132455993469,+ "r4": 0.7102+ },+ {+ "bits": 4604596001534018532,+ "r4": 0.7128+ },+ {+ "bits": 4604619870612043596,+ "r4": 0.7155+ },+ {+ "bits": 4604643739690068659,+ "r4": 0.7181+ },+ {+ "bits": 4604667608768093723,+ "r4": 0.7208+ },+ {+ "bits": 4604691477846118787,+ "r4": 0.7235+ },+ {+ "bits": 4604715346924143850,+ "r4": 0.7261+ },+ {+ "bits": 4604739216002168914,+ "r4": 0.7288+ },+ {+ "bits": 4604763085080193978,+ "r4": 0.7314+ },+ {+ "bits": 4604786954158219041,+ "r4": 0.734+ },+ {+ "bits": 4604810823236244105,+ "r4": 0.7367+ },+ {+ "bits": 4604834692314269168,+ "r4": 0.7393+ },+ {+ "bits": 4604858561392294232,+ "r4": 0.742+ },+ {+ "bits": 4604882430470319296,+ "r4": 0.7447+ },+ {+ "bits": 4604906299548344359,+ "r4": 0.7473+ },+ {+ "bits": 4604930168626369423,+ "r4": 0.75+ },+ {+ "bits": 4604954037704394487,+ "r4": 0.7526+ },+ {+ "bits": 4604977906782419550,+ "r4": 0.7552+ },+ {+ "bits": 4605001775860444614,+ "r4": 0.7579+ },+ {+ "bits": 4605025644938469677,+ "r4": 0.7605+ },+ {+ "bits": 4605049514016494741,+ "r4": 0.7632+ },+ {+ "bits": 4605073383094519805,+ "r4": 0.7659+ },+ {+ "bits": 4605097252172544868,+ "r4": 0.7685+ },+ {+ "bits": 4605121121250569932,+ "r4": 0.7712+ },+ {+ "bits": 4605144990328594996,+ "r4": 0.7738+ },+ {+ "bits": 4605168859406620059,+ "r4": 0.7764+ },+ {+ "bits": 4605192728484645123,+ "r4": 0.7791+ },+ {+ "bits": 4605216597562670186,+ "r4": 0.7817+ },+ {+ "bits": 4605240466640695250,+ "r4": 0.7844+ },+ {+ "bits": 4605264335718720314,+ "r4": 0.7871+ },+ {+ "bits": 4605288204796745377,+ "r4": 0.7897+ },+ {+ "bits": 4605312073874770441,+ "r4": 0.7923+ },+ {+ "bits": 4605335942952795505,+ "r4": 0.795+ },+ {+ "bits": 4605359812030820568,+ "r4": 0.7976+ },+ {+ "bits": 4605383681108845632,+ "r4": 0.8003+ },+ {+ "bits": 4605407550186870696,+ "r4": 0.803+ },+ {+ "bits": 4605431419264895759,+ "r4": 0.8056+ },+ {+ "bits": 4605455288342920823,+ "r4": 0.8083+ },+ {+ "bits": 4605479157420945886,+ "r4": 0.8109+ },+ {+ "bits": 4605503026498970950,+ "r4": 0.8135+ },+ {+ "bits": 4605526895576996014,+ "r4": 0.8162+ },+ {+ "bits": 4605550764655021077,+ "r4": 0.8188+ },+ {+ "bits": 4605574633733046141,+ "r4": 0.8215+ },+ {+ "bits": 4605598502811071205,+ "r4": 0.8242+ },+ {+ "bits": 4605622371889096268,+ "r4": 0.8268+ },+ {+ "bits": 4605646240967121332,+ "r4": 0.8295+ },+ {+ "bits": 4605670110045146395,+ "r4": 0.8321+ },+ {+ "bits": 4605693979123171459,+ "r4": 0.8347+ },+ {+ "bits": 4605717848201196523,+ "r4": 0.8374+ },+ {+ "bits": 4605741717279221586,+ "r4": 0.84+ },+ {+ "bits": 4605765586357246650,+ "r4": 0.8427+ },+ {+ "bits": 4605789455435271714,+ "r4": 0.8454+ },+ {+ "bits": 4605813324513296777,+ "r4": 0.848+ },+ {+ "bits": 4605837193591321841,+ "r4": 0.8507+ },+ {+ "bits": 4605861062669346904,+ "r4": 0.8533+ },+ {+ "bits": 4605884931747371968,+ "r4": 0.8559+ },+ {+ "bits": 4605908800825397032,+ "r4": 0.8586+ },+ {+ "bits": 4605932669903422095,+ "r4": 0.8612+ },+ {+ "bits": 4605956538981447159,+ "r4": 0.8639+ },+ {+ "bits": 4605980408059472223,+ "r4": 0.8666+ },+ {+ "bits": 4606004277137497286,+ "r4": 0.8692+ },+ {+ "bits": 4606028146215522350,+ "r4": 0.8719+ },+ {+ "bits": 4606052015293547414,+ "r4": 0.8745+ },+ {+ "bits": 4606075884371572477,+ "r4": 0.8771+ },+ {+ "bits": 4606099753449597541,+ "r4": 0.8798+ },+ {+ "bits": 4606123622527622604,+ "r4": 0.8824+ },+ {+ "bits": 4606147491605647668,+ "r4": 0.8851+ },+ {+ "bits": 4606171360683672732,+ "r4": 0.8878+ },+ {+ "bits": 4606195229761697795,+ "r4": 0.8904+ },+ {+ "bits": 4606219098839722859,+ "r4": 0.8931+ },+ {+ "bits": 4606242967917747923,+ "r4": 0.8957+ },+ {+ "bits": 4606266836995772986,+ "r4": 0.8983+ },+ {+ "bits": 4606290706073798050,+ "r4": 0.901+ },+ {+ "bits": 4606314575151823113,+ "r4": 0.9036+ },+ {+ "bits": 4606338444229848177,+ "r4": 0.9063+ },+ {+ "bits": 4606362313307873241,+ "r4": 0.909+ },+ {+ "bits": 4606386182385898304,+ "r4": 0.9116+ },+ {+ "bits": 4606410051463923368,+ "r4": 0.9143+ },+ {+ "bits": 4606433920541948432,+ "r4": 0.9169+ },+ {+ "bits": 4606457789619973495,+ "r4": 0.9195+ },+ {+ "bits": 4606481658697998559,+ "r4": 0.9222+ },+ {+ "bits": 4606505527776023622,+ "r4": 0.9248+ },+ {+ "bits": 4606529396854048686,+ "r4": 0.9275+ },+ {+ "bits": 4606553265932073750,+ "r4": 0.9302+ },+ {+ "bits": 4606577135010098813,+ "r4": 0.9328+ },+ {+ "bits": 4606601004088123877,+ "r4": 0.9355+ },+ {+ "bits": 4606624873166148941,+ "r4": 0.9381+ },+ {+ "bits": 4606648742244174004,+ "r4": 0.9407+ },+ {+ "bits": 4606672611322199068,+ "r4": 0.9434+ },+ {+ "bits": 4606696480400224131,+ "r4": 0.946+ },+ {+ "bits": 4606720349478249195,+ "r4": 0.9487+ },+ {+ "bits": 4606744218556274259,+ "r4": 0.9514+ },+ {+ "bits": 4606768087634299322,+ "r4": 0.954+ },+ {+ "bits": 4606791956712324386,+ "r4": 0.9567+ },+ {+ "bits": 4606815825790349450,+ "r4": 0.9593+ },+ {+ "bits": 4606839694868374513,+ "r4": 0.9619+ },+ {+ "bits": 4606863563946399577,+ "r4": 0.9646+ },+ {+ "bits": 4606887433024424641,+ "r4": 0.9673+ },+ {+ "bits": 4606911302102449704,+ "r4": 0.9699+ },+ {+ "bits": 4606935171180474768,+ "r4": 0.9726+ },+ {+ "bits": 4606959040258499831,+ "r4": 0.9752+ },+ {+ "bits": 4606982909336524895,+ "r4": 0.9778+ },+ {+ "bits": 4607006778414549959,+ "r4": 0.9805+ },+ {+ "bits": 4607030647492575022,+ "r4": 0.9831+ },+ {+ "bits": 4607054516570600086,+ "r4": 0.9858+ },+ {+ "bits": 4607078385648625150,+ "r4": 0.9885+ },+ {+ "bits": 4607102254726650213,+ "r4": 0.9911+ },+ {+ "bits": 4607126123804675277,+ "r4": 0.9938+ },+ {+ "bits": 4607149992882700340,+ "r4": 0.9964+ },+ {+ "bits": 4607173861960725404,+ "r4": 0.999+ }+ ],+ "uniform": [+ {+ "bits": 4601128844155971884,+ "r4": 0.414+ },+ {+ "bits": 4604683519597799076,+ "r4": 0.7226+ },+ {+ "bits": 4600976689481615258,+ "r4": 0.4055+ },+ {+ "bits": 4606904848212732228,+ "r4": 0.9692+ },+ {+ "bits": 4583722555371452352,+ "r4": 0.028+ },+ {+ "bits": 4603019028429443428,+ "r4": 0.5378+ },+ {+ "bits": 4596160836677785068,+ "r4": 0.1941+ },+ {+ "bits": 4592907658659359712,+ "r4": 0.1144+ },+ {+ "bits": 4585114603616820448,+ "r4": 0.0344+ },+ {+ "bits": 4599460846906021408,+ "r4": 0.3214+ },+ {+ "bits": 4600272585164157618,+ "r4": 0.3664+ },+ {+ "bits": 4600364653746465758,+ "r4": 0.3715+ },+ {+ "bits": 4589583581586080208,+ "r4": 0.0683+ },+ {+ "bits": 4603175274374365794,+ "r4": 0.5551+ },+ {+ "bits": 4605838795695892565,+ "r4": 0.8508+ },+ {+ "bits": 4573971809151301376,+ "r4": 0.0064+ },+ {+ "bits": 4603265117721795341,+ "r4": 0.5651+ },+ {+ "bits": 4600948933487809488,+ "r4": 0.404+ },+ {+ "bits": 4606432085346201998,+ "r4": 0.9167+ },+ {+ "bits": 4600486235674533200,+ "r4": 0.3783+ },+ {+ "bits": 4600031615806654414,+ "r4": 0.3531+ },+ {+ "bits": 4605624399548874202,+ "r4": 0.827+ },+ {+ "bits": 4603286081136510282,+ "r4": 0.5674+ },+ {+ "bits": 4606403666893737514,+ "r4": 0.9135+ },+ {+ "bits": 4606493726549362094,+ "r4": 0.9235+ },+ {+ "bits": 4595022296078391196,+ "r4": 0.1625+ },+ {+ "bits": 4606228777620965019,+ "r4": 0.8941+ },+ {+ "bits": 4596238692378150924,+ "r4": 0.1963+ },+ {+ "bits": 4605404044460725140,+ "r4": 0.8026+ },+ {+ "bits": 4597295311725342512,+ "r4": 0.2256+ },+ {+ "bits": 4603279966317789971,+ "r4": 0.5667+ },+ {+ "bits": 4604667308488468291,+ "r4": 0.7208+ },+ {+ "bits": 4599171451126471820,+ "r4": 0.3053+ },+ {+ "bits": 4599121644728750722,+ "r4": 0.3025+ },+ {+ "bits": 4605204276739671233,+ "r4": 0.7804+ },+ {+ "bits": 4604507935825100510,+ "r4": 0.7031+ },+ {+ "bits": 4604487542295482440,+ "r4": 0.7008+ },+ {+ "bits": 4600307670281728710,+ "r4": 0.3684+ },+ {+ "bits": 4606076483954305866,+ "r4": 0.8772+ },+ {+ "bits": 4597187707303507344,+ "r4": 0.2226+ },+ {+ "bits": 4593904961389287352,+ "r4": 0.1315+ },+ {+ "bits": 4604597267923837164,+ "r4": 0.713+ },+ {+ "bits": 4601593436217817518,+ "r4": 0.4397+ },+ {+ "bits": 4604554617345924169,+ "r4": 0.7083+ },+ {+ "bits": 4603806832072747908,+ "r4": 0.6252+ },+ {+ "bits": 4603943993075052324,+ "r4": 0.6405+ },+ {+ "bits": 4605936980048936146,+ "r4": 0.8617+ },+ {+ "bits": 4602436455881952362,+ "r4": 0.4865+ },+ {+ "bits": 4600438335434671498,+ "r4": 0.3756+ },+ {+ "bits": 4594688715706450888,+ "r4": 0.1532+ },+ {+ "bits": 4605858320743303798,+ "r4": 0.853+ },+ {+ "bits": 4601903611057321540,+ "r4": 0.457+ },+ {+ "bits": 4600896388385138962,+ "r4": 0.4011+ },+ {+ "bits": 4597337595366500448,+ "r4": 0.2268+ },+ {+ "bits": 4603276863227528213,+ "r4": 0.5664+ },+ {+ "bits": 4601915061579833214,+ "r4": 0.4576+ },+ {+ "bits": 4603391414595901675,+ "r4": 0.5791+ },+ {+ "bits": 4601872700812217122,+ "r4": 0.4553+ },+ {+ "bits": 4598525921576597360,+ "r4": 0.2695+ },+ {+ "bits": 4601061455860363514,+ "r4": 0.4102+ },+ {+ "bits": 4594054042644668452,+ "r4": 0.1356+ },+ {+ "bits": 4603592766957081596,+ "r4": 0.6015+ },+ {+ "bits": 4605221016120929214,+ "r4": 0.7822+ },+ {+ "bits": 4605318379041061782,+ "r4": 0.7931+ },+ {+ "bits": 4604257461925383965,+ "r4": 0.6753+ },+ {+ "bits": 4600297217171132864,+ "r4": 0.3678+ },+ {+ "bits": 4604447927122513027,+ "r4": 0.6964+ },+ {+ "bits": 4606856645423671573,+ "r4": 0.9638+ },+ {+ "bits": 4604198986960318968,+ "r4": 0.6688+ },+ {+ "bits": 4604314862894005507,+ "r4": 0.6816+ },+ {+ "bits": 4596904040752859968,+ "r4": 0.2147+ },+ {+ "bits": 4597111875833434432,+ "r4": 0.2205+ },+ {+ "bits": 4597973019965926272,+ "r4": 0.2444+ },+ {+ "bits": 4604941654935196422,+ "r4": 0.7512+ },+ {+ "bits": 4600707549091506902,+ "r4": 0.3906+ },+ {+ "bits": 4596126403134885324,+ "r4": 0.1931+ },+ {+ "bits": 4598106956418994916,+ "r4": 0.2481+ },+ {+ "bits": 4604993450241300560,+ "r4": 0.757+ },+ {+ "bits": 4603075609597308186,+ "r4": 0.5441+ },+ {+ "bits": 4603470254301018775,+ "r4": 0.5879+ },+ {+ "bits": 4605435918568193698,+ "r4": 0.8061+ },+ {+ "bits": 4593786788921441856,+ "r4": 0.1282+ },+ {+ "bits": 4604699432642525825,+ "r4": 0.7243+ },+ {+ "bits": 4593708649578619384,+ "r4": 0.126+ },+ {+ "bits": 4606781461982245393,+ "r4": 0.9555+ },+ {+ "bits": 4585624046856739760,+ "r4": 0.0379+ },+ {+ "bits": 4585061283758278864,+ "r4": 0.034+ },+ {+ "bits": 4602676221772590416,+ "r4": 0.4999+ },+ {+ "bits": 4591429763885281808,+ "r4": 0.0939+ },+ {+ "bits": 4593956118717095404,+ "r4": 0.1329+ },+ {+ "bits": 4603126829964557283,+ "r4": 0.5497+ },+ {+ "bits": 4606658427227316290,+ "r4": 0.9418+ },+ {+ "bits": 4606318324210446561,+ "r4": 0.9041+ },+ {+ "bits": 4598405323321580560,+ "r4": 0.2628+ },+ {+ "bits": 4604711534609665123,+ "r4": 0.7257+ },+ {+ "bits": 4592102388716507728,+ "r4": 0.1032+ },+ {+ "bits": 4603844441089576847,+ "r4": 0.6294+ },+ {+ "bits": 4601020125348031328,+ "r4": 0.4079+ },+ {+ "bits": 4603156241560452202,+ "r4": 0.553+ },+ {+ "bits": 4605716601064385252,+ "r4": 0.8373+ },+ {+ "bits": 4607033290061408205,+ "r4": 0.9834+ },+ {+ "bits": 4601929045401474876,+ "r4": 0.4584+ },+ {+ "bits": 4605925528753627747,+ "r4": 0.8605+ },+ {+ "bits": 4598555097193571172,+ "r4": 0.2711+ },+ {+ "bits": 4606889663580539120,+ "r4": 0.9675+ },+ {+ "bits": 4606892542704132804,+ "r4": 0.9678+ },+ {+ "bits": 4601215276489637836,+ "r4": 0.4188+ },+ {+ "bits": 4597398316026794632,+ "r4": 0.2284+ },+ {+ "bits": 4606105615477511491,+ "r4": 0.8805+ },+ {+ "bits": 4596717201183927432,+ "r4": 0.2095+ },+ {+ "bits": 4606655593523693513,+ "r4": 0.9415+ },+ {+ "bits": 4606056379924651904,+ "r4": 0.875+ },+ {+ "bits": 4603782632695847309,+ "r4": 0.6225+ },+ {+ "bits": 4601569362416166540,+ "r4": 0.4384+ },+ {+ "bits": 4604880915867042251,+ "r4": 0.7445+ },+ {+ "bits": 4606240857991979083,+ "r4": 0.8955+ },+ {+ "bits": 4604289885546728245,+ "r4": 0.6789+ },+ {+ "bits": 4598302425185992870,+ "r4": 0.2571+ },+ {+ "bits": 4605224733880356041,+ "r4": 0.7827+ },+ {+ "bits": 4586819593846833440,+ "r4": 0.0462+ },+ {+ "bits": 4603488389554453579,+ "r4": 0.5899+ },+ {+ "bits": 4601454032046961344,+ "r4": 0.432+ },+ {+ "bits": 4606725346888131779,+ "r4": 0.9493+ },+ {+ "bits": 4604581000539251751,+ "r4": 0.7112+ },+ {+ "bits": 4605159575174638531,+ "r4": 0.7754+ },+ {+ "bits": 4606962935733912001,+ "r4": 0.9756+ },+ {+ "bits": 4575855362172950912,+ "r4": 0.0082+ },+ {+ "bits": 4589816988616660784,+ "r4": 0.0715+ },+ {+ "bits": 4598685182230591930,+ "r4": 0.2783+ },+ {+ "bits": 4590005810472361080,+ "r4": 0.0741+ },+ {+ "bits": 4602769076052980118,+ "r4": 0.51+ },+ {+ "bits": 4603962691853789071,+ "r4": 0.6425+ },+ {+ "bits": 4574308453011327488,+ "r4": 0.0066+ },+ {+ "bits": 4599176252798415628,+ "r4": 0.3056+ },+ {+ "bits": 4603261249213821586,+ "r4": 0.5647+ },+ {+ "bits": 4597584005548944516,+ "r4": 0.2336+ },+ {+ "bits": 4603044565811131591,+ "r4": 0.5406+ },+ {+ "bits": 4603997641087532099,+ "r4": 0.6464+ },+ {+ "bits": 4599758697698593312,+ "r4": 0.3379+ },+ {+ "bits": 4605418243308290904,+ "r4": 0.8041+ },+ {+ "bits": 4591379613375051680,+ "r4": 0.0932+ },+ {+ "bits": 4606351761933612406,+ "r4": 0.9078+ },+ {+ "bits": 4605317227588909000,+ "r4": 0.7929+ },+ {+ "bits": 4605907190270653477,+ "r4": 0.8584+ },+ {+ "bits": 4605170480845197687,+ "r4": 0.7766+ },+ {+ "bits": 4600489236918030692,+ "r4": 0.3785+ },+ {+ "bits": 4606022582003057829,+ "r4": 0.8712+ },+ {+ "bits": 4599495217085189124,+ "r4": 0.3233+ },+ {+ "bits": 4586235034803330272,+ "r4": 0.0421+ },+ {+ "bits": 4598669801160544376,+ "r4": 0.2775+ },+ {+ "bits": 4596249372040605624,+ "r4": 0.1965+ },+ {+ "bits": 4602953883561879702,+ "r4": 0.5305+ },+ {+ "bits": 4596846801103883088,+ "r4": 0.2131+ },+ {+ "bits": 4596553916510848456,+ "r4": 0.205+ },+ {+ "bits": 4603125122161529482,+ "r4": 0.5495+ },+ {+ "bits": 4599568842749811106,+ "r4": 0.3274+ },+ {+ "bits": 4592170948654407872,+ "r4": 0.1042+ },+ {+ "bits": 4607101337591647804,+ "r4": 0.991+ },+ {+ "bits": 4601223223455870608,+ "r4": 0.4192+ },+ {+ "bits": 4603218312305826643,+ "r4": 0.5599+ },+ {+ "bits": 4606023246712664218,+ "r4": 0.8713+ },+ {+ "bits": 4603383678412901151,+ "r4": 0.5783+ },+ {+ "bits": 4603280135479316641,+ "r4": 0.5668+ },+ {+ "bits": 4598183567325785698,+ "r4": 0.2505+ },+ {+ "bits": 4602061425373875746,+ "r4": 0.4657+ },+ {+ "bits": 4604232933989336904,+ "r4": 0.6725+ },+ {+ "bits": 4602149101778453896,+ "r4": 0.4706+ },+ {+ "bits": 4602395100870493242,+ "r4": 0.4843+ },+ {+ "bits": 4595852897918244736,+ "r4": 0.1855+ },+ {+ "bits": 4601693054157893588,+ "r4": 0.4453+ },+ {+ "bits": 4597565424232609492,+ "r4": 0.2331+ },+ {+ "bits": 4603803220891566918,+ "r4": 0.6248+ },+ {+ "bits": 4604457940416586613,+ "r4": 0.6975+ },+ {+ "bits": 4602630334819522332,+ "r4": 0.4973+ },+ {+ "bits": 4587394918353430480,+ "r4": 0.0502+ },+ {+ "bits": 4586043284430623264,+ "r4": 0.0408+ },+ {+ "bits": 4595769053024303524,+ "r4": 0.1832+ },+ {+ "bits": 4588635435232453408,+ "r4": 0.0588+ },+ {+ "bits": 4602823905930307569,+ "r4": 0.5161+ },+ {+ "bits": 4605324149971200566,+ "r4": 0.7937+ },+ {+ "bits": 4602418651893830260,+ "r4": 0.4856+ },+ {+ "bits": 4596109696240869308,+ "r4": 0.1927+ },+ {+ "bits": 4605913710456977878,+ "r4": 0.8591+ },+ {+ "bits": 4603475145082453800,+ "r4": 0.5884+ },+ {+ "bits": 4603272053400502420,+ "r4": 0.5659+ },+ {+ "bits": 4605913584370134627,+ "r4": 0.8591+ },+ {+ "bits": 4603131215377150467,+ "r4": 0.5502+ },+ {+ "bits": 4602055202644489642,+ "r4": 0.4654+ },+ {+ "bits": 4600695015896274694,+ "r4": 0.3899+ },+ {+ "bits": 4586639223838241968,+ "r4": 0.045+ },+ {+ "bits": 4598737611746547392,+ "r4": 0.2812+ },+ {+ "bits": 4603013435724694069,+ "r4": 0.5371+ },+ {+ "bits": 4603053517669790797,+ "r4": 0.5416+ },+ {+ "bits": 4598366249749540200,+ "r4": 0.2606+ },+ {+ "bits": 4604672119904740384,+ "r4": 0.7213+ },+ {+ "bits": 4591120060288746672,+ "r4": 0.0896+ },+ {+ "bits": 4600692332227640852,+ "r4": 0.3897+ },+ {+ "bits": 4598929983486974504,+ "r4": 0.2919+ },+ {+ "bits": 4589902638271473432,+ "r4": 0.0727+ },+ {+ "bits": 4600163574203571528,+ "r4": 0.3604+ },+ {+ "bits": 4584115271149695872,+ "r4": 0.0293+ },+ {+ "bits": 4594453053545078832,+ "r4": 0.1467+ },+ {+ "bits": 4607009167254348596,+ "r4": 0.9808+ },+ {+ "bits": 4601117087277526072,+ "r4": 0.4133+ },+ {+ "bits": 4605674274921554100,+ "r4": 0.8326+ },+ {+ "bits": 4603631225693203520,+ "r4": 0.6057+ },+ {+ "bits": 4586373445748130592,+ "r4": 0.0431+ },+ {+ "bits": 4599826606658809062,+ "r4": 0.3417+ },+ {+ "bits": 4593283811854157328,+ "r4": 0.1196+ },+ {+ "bits": 4605400450920713044,+ "r4": 0.8022+ },+ {+ "bits": 4605606249685187947,+ "r4": 0.825+ },+ {+ "bits": 4606850922818734123,+ "r4": 0.9632+ },+ {+ "bits": 4587210251265818224,+ "r4": 0.0489+ },+ {+ "bits": 4593892079676313328,+ "r4": 0.1311+ },+ {+ "bits": 4599233456306046126,+ "r4": 0.3087+ },+ {+ "bits": 4603117913985342090,+ "r4": 0.5487+ },+ {+ "bits": 4604083653667719970,+ "r4": 0.656+ },+ {+ "bits": 4604407420891619544,+ "r4": 0.6919+ },+ {+ "bits": 4591977560312910584,+ "r4": 0.1015+ },+ {+ "bits": 4601515051301650528,+ "r4": 0.4354+ },+ {+ "bits": 4597100374038396044,+ "r4": 0.2202+ },+ {+ "bits": 4605262723821973120,+ "r4": 0.7869+ },+ {+ "bits": 4603059264065767166,+ "r4": 0.5422+ },+ {+ "bits": 4593964265376600088,+ "r4": 0.1331+ },+ {+ "bits": 4603757664497649761,+ "r4": 0.6198+ },+ {+ "bits": 4591278569134977488,+ "r4": 0.0918+ },+ {+ "bits": 4585646852789777744,+ "r4": 0.0381+ },+ {+ "bits": 4585724686953584032,+ "r4": 0.0386+ },+ {+ "bits": 4593005024328726536,+ "r4": 0.1157+ },+ {+ "bits": 4606850228528168608,+ "r4": 0.9631+ },+ {+ "bits": 4584902496695801024,+ "r4": 0.0329+ },+ {+ "bits": 4595114581440552864,+ "r4": 0.1651+ },+ {+ "bits": 4604517562928253205,+ "r4": 0.7041+ },+ {+ "bits": 4599897310520607814,+ "r4": 0.3456+ },+ {+ "bits": 4585571982011274864,+ "r4": 0.0375+ },+ {+ "bits": 4585527546159324640,+ "r4": 0.0372+ },+ {+ "bits": 4603981020761264903,+ "r4": 0.6446+ },+ {+ "bits": 4599304901099925682,+ "r4": 0.3127+ },+ {+ "bits": 4602328982506293742,+ "r4": 0.4806+ },+ {+ "bits": 4602871580608488386,+ "r4": 0.5214+ },+ {+ "bits": 4595347707871576572,+ "r4": 0.1715+ },+ {+ "bits": 4600061494342147246,+ "r4": 0.3547+ },+ {+ "bits": 4606394703159359320,+ "r4": 0.9125+ },+ {+ "bits": 4603746873660682373,+ "r4": 0.6186+ },+ {+ "bits": 4604422391073035027,+ "r4": 0.6936+ },+ {+ "bits": 4598780259477612506,+ "r4": 0.2836+ },+ {+ "bits": 4599058886784332922,+ "r4": 0.2991+ },+ {+ "bits": 4597621147664423996,+ "r4": 0.2346+ },+ {+ "bits": 4604467507902975411,+ "r4": 0.6986+ },+ {+ "bits": 4598966666924029466,+ "r4": 0.2939+ },+ {+ "bits": 4594334917924351180,+ "r4": 0.1434+ },+ {+ "bits": 4599910380506935318,+ "r4": 0.3463+ },+ {+ "bits": 4606113130153474485,+ "r4": 0.8813+ },+ {+ "bits": 4601108689614039680,+ "r4": 0.4128+ },+ {+ "bits": 4604832218578045575,+ "r4": 0.7391+ },+ {+ "bits": 4603248741694210652,+ "r4": 0.5633+ },+ {+ "bits": 4605065444483398480,+ "r4": 0.765+ },+ {+ "bits": 4604635531440049859,+ "r4": 0.7172+ },+ {+ "bits": 4602127644861237334,+ "r4": 0.4694+ },+ {+ "bits": 4594194038133802564,+ "r4": 0.1395+ },+ {+ "bits": 4603641625690245158,+ "r4": 0.6069+ },+ {+ "bits": 4604198200040939535,+ "r4": 0.6687+ },+ {+ "bits": 4595370485365083900,+ "r4": 0.1722+ },+ {+ "bits": 4602645872934035176,+ "r4": 0.4982+ },+ {+ "bits": 4599677346007662986,+ "r4": 0.3334+ },+ {+ "bits": 4599484090415123468,+ "r4": 0.3227+ },+ {+ "bits": 4600708826968379224,+ "r4": 0.3906+ },+ {+ "bits": 4597710715028500512,+ "r4": 0.2371+ },+ {+ "bits": 4599805129780657584,+ "r4": 0.3405+ },+ {+ "bits": 4592694471698338328,+ "r4": 0.1114+ },+ {+ "bits": 4605487003338786691,+ "r4": 0.8118+ },+ {+ "bits": 4604688236141307723,+ "r4": 0.7231+ },+ {+ "bits": 4596752525158117140,+ "r4": 0.2105+ },+ {+ "bits": 4605278568691371304,+ "r4": 0.7886+ },+ {+ "bits": 4606836546648348631,+ "r4": 0.9616+ },+ {+ "bits": 4600400595950827018,+ "r4": 0.3735+ },+ {+ "bits": 4598480239216716882,+ "r4": 0.2669+ },+ {+ "bits": 4604115018501732813,+ "r4": 0.6595+ },+ {+ "bits": 4600217346145874916,+ "r4": 0.3634+ },+ {+ "bits": 4599385236165219610,+ "r4": 0.3172+ },+ {+ "bits": 4606483700237734968,+ "r4": 0.9224+ },+ {+ "bits": 4587747420033974000,+ "r4": 0.0526+ },+ {+ "bits": 4605089059375807123,+ "r4": 0.7676+ },+ {+ "bits": 4596120777927569756,+ "r4": 0.193+ },+ {+ "bits": 4605703577677543096,+ "r4": 0.8358+ },+ {+ "bits": 4605489104046450813,+ "r4": 0.812+ },+ {+ "bits": 4601213969782120266,+ "r4": 0.4187+ },+ {+ "bits": 4603978650272909128,+ "r4": 0.6443+ },+ {+ "bits": 4605784724347721014,+ "r4": 0.8448+ },+ {+ "bits": 4606075409808674895,+ "r4": 0.8771+ },+ {+ "bits": 4603973792717388040,+ "r4": 0.6438+ },+ {+ "bits": 4604183971340971118,+ "r4": 0.6671+ },+ {+ "bits": 4596721359317837884,+ "r4": 0.2096+ },+ {+ "bits": 4604178235090856757,+ "r4": 0.6665+ },+ {+ "bits": 4604405796021167182,+ "r4": 0.6917+ },+ {+ "bits": 4598650099641315218,+ "r4": 0.2764+ },+ {+ "bits": 4598393073357664142,+ "r4": 0.2621+ },+ {+ "bits": 4603624187163237248,+ "r4": 0.605+ },+ {+ "bits": 4604903473649547401,+ "r4": 0.747+ },+ {+ "bits": 4594058369040014100,+ "r4": 0.1357+ }+ ]+ }+}diff --git a/laya-java/fixtures/tokenizer_ids.json b/laya-java/fixtures/tokenizer_ids.jsonindex e44c545f..462ecd76 100644--- a/laya-java/fixtures/tokenizer_ids.json+++ b/laya-java/fixtures/tokenizer_ids.json@@ -7,7 +7,12 @@"merges": 50009,"pre_tokenizer": "ByteLevel","normalizer": "NFC",- "unk_token": null+ "unk_token": null,+ "added_tokens": 116,+ "added_tokens_outside_vocab": 88,+ "byte_fallback": false,+ "ignore_merges": false,+ "fuse_unk": false},"special_ids": {"cls": 50281,@@ -3496,7 +3501,12 @@"merges": 580604,"pre_tokenizer": "Metaspace","normalizer": "Replace",- "unk_token": "<unk>"+ "unk_token": "<unk>",+ "added_tokens": 249,+ "added_tokens_outside_vocab": 0,+ "byte_fallback": true,+ "ignore_merges": false,+ "fuse_unk": true},"special_ids": {"cls": 2,diff --git a/laya-java/gradle/wrapper/gradle-wrapper.jar b/laya-java/gradle/wrapper/gradle-wrapper.jarnew file mode 100644index 00000000..a4b76b95Binary files /dev/null and b/laya-java/gradle/wrapper/gradle-wrapper.jar differdiff --git a/laya-java/gradle/wrapper/gradle-wrapper.properties b/laya-java/gradle/wrapper/gradle-wrapper.propertiesnew file mode 100644index 00000000..df97d72b--- /dev/null+++ b/laya-java/gradle/wrapper/gradle-wrapper.properties@@ -0,0 +1,7 @@+distributionBase=GRADLE_USER_HOME+distributionPath=wrapper/dists+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip+networkTimeout=10000+validateDistributionUrl=true+zipStoreBase=GRADLE_USER_HOME+zipStorePath=wrapper/distsdiff --git a/laya-java/gradlew b/laya-java/gradlewnew file mode 100755index 00000000..f5feea6d--- /dev/null+++ b/laya-java/gradlew@@ -0,0 +1,252 @@+#!/bin/sh++#+# Copyright © 2015-2021 the original authors.+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# https://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+#+# SPDX-License-Identifier: Apache-2.0+#++##############################################################################+#+# Gradle start up script for POSIX generated by Gradle.+#+# Important for running:+#+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is+# noncompliant, but you have some other compliant shell such as ksh or+# bash, then to run this script, type that shell name before the whole+# command line, like:+#+# ksh Gradle+#+# Busybox and similar reduced shells will NOT work, because this script+# requires all of these POSIX shell features:+# * functions;+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;+# * compound commands having a testable exit status, especially «case»;+# * various built-in commands including «command», «set», and «ulimit».+#+# Important for patching:+#+# (2) This script targets any POSIX shell, so it avoids extensions provided+# by Bash, Ksh, etc; in particular arrays are avoided.+#+# The "traditional" practice of packing multiple parameters into a+# space-separated string is a well documented source of bugs and security+# problems, so this is (mostly) avoided, by progressively accumulating+# options in "$@", and eventually passing that to Java.+#+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;+# see the in-line comments for details.+#+# There are tweaks for specific operating systems such as AIX, CygWin,+# Darwin, MinGW, and NonStop.+#+# (3) This script is generated from the Groovy template+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt+# within the Gradle project.+#+# You can find Gradle at https://github.com/gradle/gradle/.+#+##############################################################################++# Attempt to set APP_HOME++# Resolve links: $0 may be a link+app_path=$0++# Need this for daisy-chained symlinks.+while+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path+ [ -h "$app_path" ]+do+ ls=$( ls -ld "$app_path" )+ link=${ls#*' -> '}+ case $link in #(+ /*) app_path=$link ;; #(+ *) app_path=$APP_HOME$link ;;+ esac+done++# This is normally unused+# shellcheck disable=SC2034+APP_BASE_NAME=${0##*/}+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s+' "$PWD" ) || exit++# Use the maximum available, or set MAX_FD != -1 to use that value.+MAX_FD=maximum++warn () {+ echo "$*"+} >&2++die () {+ echo+ echo "$*"+ echo+ exit 1+} >&2++# OS specific support (must be 'true' or 'false').+cygwin=false+msys=false+darwin=false+nonstop=false+case "$( uname )" in #(+ CYGWIN* ) cygwin=true ;; #(+ Darwin* ) darwin=true ;; #(+ MSYS* | MINGW* ) msys=true ;; #(+ NONSTOP* ) nonstop=true ;;+esac++CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar+++# Determine the Java command to use to start the JVM.+if [ -n "$JAVA_HOME" ] ; then+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then+ # IBM's JDK on AIX uses strange locations for the executables+ JAVACMD=$JAVA_HOME/jre/sh/java+ else+ JAVACMD=$JAVA_HOME/bin/java+ fi+ if [ ! -x "$JAVACMD" ] ; then+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME++Please set the JAVA_HOME variable in your environment to match the+location of your Java installation."+ fi+else+ JAVACMD=java+ if ! command -v java >/dev/null 2>&1+ then+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.++Please set the JAVA_HOME variable in your environment to match the+location of your Java installation."+ fi+fi++# Increase the maximum file descriptors if we can.+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then+ case $MAX_FD in #(+ max*)+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.+ # shellcheck disable=SC2039,SC3045+ MAX_FD=$( ulimit -H -n ) ||+ warn "Could not query maximum file descriptor limit"+ esac+ case $MAX_FD in #(+ '' | soft) :;; #(+ *)+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.+ # shellcheck disable=SC2039,SC3045+ ulimit -n "$MAX_FD" ||+ warn "Could not set maximum file descriptor limit to $MAX_FD"+ esac+fi++# Collect all arguments for the java command, stacking in reverse order:+# * args from the command line+# * the main class name+# * -classpath+# * -D...appname settings+# * --module-path (only if needed)+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.++# For Cygwin or MSYS, switch paths to Windows format before running java+if "$cygwin" || "$msys" ; then+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )++ JAVACMD=$( cygpath --unix "$JAVACMD" )++ # Now convert the arguments - kludge to limit ourselves to /bin/sh+ for arg do+ if+ case $arg in #(+ -*) false ;; # don't mess with options #(+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath+ [ -e "$t" ] ;; #(+ *) false ;;+ esac+ then+ arg=$( cygpath --path --ignore --mixed "$arg" )+ fi+ # Roll the args list around exactly as many times as the number of+ # args, so each arg winds up back in the position where it started, but+ # possibly modified.+ #+ # NB: a `for` loop captures its iteration list before it begins, so+ # changing the positional parameters here affects neither the number of+ # iterations, nor the values presented in `arg`.+ shift # remove old arg+ set -- "$@" "$arg" # push replacement arg+ done+fi+++# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'++# Collect all arguments for the java command:+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,+# and any embedded shellness will be escaped.+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be+# treated as '${Hostname}' itself on the command line.++set -- \+ "-Dorg.gradle.appname=$APP_BASE_NAME" \+ -classpath "$CLASSPATH" \+ org.gradle.wrapper.GradleWrapperMain \+ "$@"++# Stop when "xargs" is not available.+if ! command -v xargs >/dev/null 2>&1+then+ die "xargs is not available"+fi++# Use "xargs" to parse quoted args.+#+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.+#+# In Bash we could simply go:+#+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&+# set -- "${ARGS[@]}" "$@"+#+# but POSIX shell has neither arrays nor command substitution, so instead we+# post-process each arg (as a line of input to sed) to backslash-escape any+# character that might be a shell metacharacter, then use eval to reverse+# that process (while maintaining the separation between arguments), and wrap+# the whole thing up as a single "set" statement.+#+# This will of course break if any of these variables contains a newline or+# an unmatched quote.+#++eval "set -- $(+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |+ xargs -n1 |+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |+ tr '\n' ' '+ )" '"$@"'++exec "$JAVACMD" "$@"diff --git a/laya-java/gradlew.bat b/laya-java/gradlew.batnew file mode 100644index 00000000..9d21a218--- /dev/null+++ b/laya-java/gradlew.bat@@ -0,0 +1,94 @@+@rem+@rem Copyright 2015 the original author or authors.+@rem+@rem Licensed under the Apache License, Version 2.0 (the "License");+@rem you may not use this file except in compliance with the License.+@rem You may obtain a copy of the License at+@rem+@rem https://www.apache.org/licenses/LICENSE-2.0+@rem+@rem Unless required by applicable law or agreed to in writing, software+@rem distributed under the License is distributed on an "AS IS" BASIS,+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+@rem See the License for the specific language governing permissions and+@rem limitations under the License.+@rem+@rem SPDX-License-Identifier: Apache-2.0+@rem++@if "%DEBUG%"=="" @echo off+@rem ##########################################################################+@rem+@rem Gradle startup script for Windows+@rem+@rem ##########################################################################++@rem Set local scope for the variables with windows NT shell+if "%OS%"=="Windows_NT" setlocal++set DIRNAME=%~dp0+if "%DIRNAME%"=="" set DIRNAME=.+@rem This is normally unused+set APP_BASE_NAME=%~n0+set APP_HOME=%DIRNAME%++@rem Resolve any "." and ".." in APP_HOME to make it shorter.+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi++@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"++@rem Find java.exe+if defined JAVA_HOME goto findJavaFromJavaHome++set JAVA_EXE=java.exe+%JAVA_EXE% -version >NUL 2>&1+if %ERRORLEVEL% equ 0 goto execute++echo. 1>&2+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2+echo. 1>&2+echo Please set the JAVA_HOME variable in your environment to match the 1>&2+echo location of your Java installation. 1>&2++goto fail++:findJavaFromJavaHome+set JAVA_HOME=%JAVA_HOME:"=%+set JAVA_EXE=%JAVA_HOME%/bin/java.exe++if exist "%JAVA_EXE%" goto execute++echo. 1>&2+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2+echo. 1>&2+echo Please set the JAVA_HOME variable in your environment to match the 1>&2+echo location of your Java installation. 1>&2++goto fail++:execute+@rem Setup the command line++set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar+++@rem Execute Gradle+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*++:end+@rem End local scope for the variables with windows NT shell+if %ERRORLEVEL% equ 0 goto mainEnd++:fail+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of+rem the _cmd.exe /c_ return code!+set EXIT_CODE=%ERRORLEVEL%+if %EXIT_CODE% equ 0 set EXIT_CODE=1+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%+exit /b %EXIT_CODE%++:mainEnd+if "%OS%"=="Windows_NT" endlocal++:omegadiff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Agent.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Agent.javaindex 774d9722..29f6eaeb 100644--- a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Agent.java+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Agent.java@@ -1,8 +1,8 @@package com.convaiinnovations.laya;-import ai.onnxruntime.OrtException;import com.convaiinnovations.laya.config.AgentConfig;import com.convaiinnovations.laya.decode.Decoder;+import com.convaiinnovations.laya.infer.InferenceSession;import com.convaiinnovations.laya.onnx.LayaSession;import com.convaiinnovations.laya.sequence.Collator;import com.convaiinnovations.laya.sequence.SequenceBuilder;@@ -16,32 +16,47 @@ import java.util.List;import java.util.Map;/**- * The runtime: ask several questions about one piece of evidence, in one forward pass.+ * The runtime: ask several typed questions about one piece of evidence, in one forward pass.** <p>laya is a "System 1" decision model -- a bidirectional encoder with a typed head, not a* generator. Every question about the same state becomes one row of a single batch, so four- * questions cost one encode of the shared document rather than four.+ * questions about a document cost one batched encode rather than four round trips.** <pre>{@code* try (Agent agent = Agent.open(modelDir, graphDir)) {* Map<String, Question> questions = new LinkedHashMap<>();- * questions.put("intent", Question.choice("What does the customer want?",- * new LinkedHashMap<>(Map.of("refund", "money back"))));- * Map<String, Answer> answers = agent.predict(email, questions, "en");+ * questions.put("intent", Question.choice("What does the customer want?", criteria));+ * questions.put("urgent", Question.noul("This needs a human today."));+ * Prediction p = agent.predict(email, questions, "en");+ * if (p.usage().truncated()) {+ * // the state did not fit: usage says how much was dropped, and from which questions+ * }* }* }</pre>*- * <p>Pass questions in a {@link LinkedHashMap}: the answers come back keyed by question id, but a- * choice's options are positional, so iteration order is part of what is asked.+ * <p>Pass questions in a {@link LinkedHashMap}: a choice's options are positional, so iteration+ * order is part of what is asked.+ *+ * <p>One session is not safe for concurrent {@code predict} calls unless ONNX Runtime is+ * configured for it; hold one {@code Agent} per worker, or serialise access.*/public final class Agent implements AutoCloseable {private final Tokenizer tokenizer;private final AgentConfig config;- private final LayaSession session;+ private final InferenceSession session;private final int padId;+ /**+ * This agent's own lifecycle, not the session's.+ *+ * <p>Tracked here rather than asked of the session: "is this agent usable" is the agent's+ * question, and putting it on {@link InferenceSession} would widen a seam that exists to be+ * narrow -- a stub would have to answer it with something, and a default answer of "open"+ * would be a lie the moment it was not.+ */+ private volatile boolean closed;- private Agent(Tokenizer tokenizer, AgentConfig config, LayaSession session, int padId) {+ private Agent(Tokenizer tokenizer, AgentConfig config, InferenceSession session, int padId) {this.tokenizer = tokenizer;this.config = config;this.session = session;@@ -54,22 +69,31 @@ public final class Agent implements AutoCloseable {* @param modelDirectory holds {@code rl_agent_config.json} and {@code tokenizer/}* @param graphDirectory holds {@code laya.onnx}, or {@code encoder.onnx} and {@code head.onnx}*/- public static Agent open(Path modelDirectory, Path graphDirectory)- throws IOException, OrtException {- return open(modelDirectory, graphDirectory, 1);+ public static Agent open(Path modelDirectory, Path graphDirectory) throws IOException {+ // 0 means "let ONNX Runtime choose", which is what the Python runtime does. Pinning one+ // thread here ran the forward pass on a single core and cost about 3x.+ return open(modelDirectory, graphDirectory, 0);}/** Opens a checkpoint with an explicit intra-op thread count. */public static Agent open(Path modelDirectory, Path graphDirectory, int threads)- throws IOException, OrtException {- Tokenizer tokenizer = Tokenizer.fromModelDirectory(modelDirectory);- AgentConfig config = AgentConfig.fromModelDirectory(modelDirectory);- LayaSession session = LayaSession.open(graphDirectory, threads);+ throws IOException {+ return using(Tokenizer.fromModelDirectory(modelDirectory),+ AgentConfig.fromModelDirectory(modelDirectory),+ LayaSession.open(graphDirectory, threads));+ }++ /**+ * Assembles an agent from parts, for a caller that already holds them -- a router sharing one+ * tokenizer across checkpoints, or a test driving the batching and usage accounting through a+ * stub {@link InferenceSession} instead of a 1.2 GB graph.+ */+ public static Agent using(Tokenizer tokenizer, AgentConfig config, InferenceSession session) {// Padding is masked out of attention but still embedded, so it has to be a real id.int padId = tokenizer.padId().orElseGet(() -> tokenizer.sepId().orElseThrow(() -> new IllegalStateException("this checkpoint names neither a pad_token nor a sep_token, so a batch "- + "of more than one question cannot be padded")));+ + "of more than one row cannot be padded")));return new Agent(tokenizer, config, session, padId);}@@ -83,57 +107,192 @@ public final class Agent implements AutoCloseable {return config;}- /** Asks every question about {@code state} in one forward pass, with no language override. */- public Map<String, Answer> predict(Object state, Map<String, Question> questions)- throws OrtException {+ /** Asks every question about one state, with no language override. */+ public Prediction predict(Object state, Map<String, Question> questions) {return predict(state, questions, null);}/**- * Asks every question about {@code state} in one forward pass.+ * Asks every question about one state in one forward pass.*- * @param language a BCP-47-ish tag whose prefix may select a temperature override, or null- * @return the answers, keyed by question id, in the order the questions were given+ * @param language a tag whose prefix before {@code -} may select a temperature override, or null*/- public Map<String, Answer> predict(Object state, Map<String, Question> questions,- String language) throws OrtException {+ public Prediction predict(Object state, Map<String, Question> questions, String language) {+ // `singletonList`, not `List.of`: a null state is legitimate -- Python serialises `None`+ // to the text "null" -- and `List.of` rejects it with a bare NullPointerException.+ return predictBatch(Collections.singletonList(state), questions, language, 0, false).get(0);+ }++ /**+ * Asks every question about every state, one row per (state, question).+ *+ * <p>Length sorting is off, which is the Python runtime's default too. It never changes an+ * answer -- it only cuts padding -- but leaving it off keeps the batched path's grouping+ * predictable, and a caller who wants the throughput can ask for it.+ */+ public List<Prediction> predictBatch(List<?> states, Map<String, Question> questions) {+ return predictBatch(states, questions, null, 0, false);+ }++ /**+ * Asks every question about every state.+ *+ * @param batchSize rows' worth of states per graph call, or 0 for all of them at once.+ * This bounds peak memory, not the answers+ * @param sortByLength group states of similar length into the same call, which cuts padding.+ * It changes nothing about the answers: every row is sliced back to its+ * own option count and the results are returned in the caller's order+ * @return one prediction per state, in the order the states were given+ */+ public List<Prediction> predictBatch(List<?> states, Map<String, Question> questions,+ String language, int batchSize, boolean sortByLength) {if (questions.isEmpty()) {- return Map.of();+ throw new IllegalArgumentException("no questions to ask");}- // The state is serialised and tokenized ONCE and reused for every question, which is what- // `build_sequence`'s `state_ids` parameter exists for: the alternative re-tokenizes the- // same document per question, and a document is usually far longer than a question.+ if (closed) {+ throw new IllegalStateException(+ "this agent is closed; open a new one rather than reusing it");+ }+ if (states.isEmpty()) {+ return List.of();+ }+ // Snapshotted once, at entry. The map is the caller's, and the sequences are built before+ // the graph runs while the answers are labelled after it: reading it twice let a mutation+ // in between attach one question's labels to another question's logits, with no exception+ // and nothing in `usage` to show it. Python snapshots for the same reason.+ Map<String, Question> asked = new LinkedHashMap<>(questions);+ for (Map.Entry<String, Question> entry : asked.entrySet()) {+ if (entry.getValue() == null) {+ throw new IllegalArgumentException("question " + entry.getKey() + " is null");+ }+ }+ List<String> questionIds = new ArrayList<>(asked.keySet());+ int chunk = batchSize > 0 ? batchSize : states.size();+ // Sorting only pays off when it can actually reorder across more than one call, which+ // mirrors the Python runtime's own guard.+ boolean reorder = sortByLength && chunk > 1 && chunk < states.size();+ // Bound the tokenized lookahead independently of the input size: sort within windows of+ // eight calls rather than over the whole input, so a million states do not have to be+ // encoded before the first one runs.+ int window = reorder ? chunk * 8 : chunk;++ Prediction[] out = new Prediction[states.size()];+ for (int start = 0; start < states.size(); start += window) {+ int end = Math.min(states.size(), start + window);+ List<List<SequenceBuilder.Sequence>> encoded = new ArrayList<>(end - start);+ for (int i = start; i < end; i++) {+ encoded.add(encodeState(states.get(i), questionIds, asked));+ }+ List<Integer> order = new ArrayList<>(encoded.size());+ for (int i = 0; i < encoded.size(); i++) {+ order.add(i);+ }+ if (reorder) {+ order.sort((a, b) -> Integer.compare(longestRow(encoded.get(a)),+ longestRow(encoded.get(b))));+ }+ for (int offset = 0; offset < order.size(); offset += chunk) {+ List<Integer> indices = order.subList(offset, Math.min(order.size(), offset + chunk));+ List<Collator.Item> rows = new ArrayList<>();+ for (int index : indices) {+ List<SequenceBuilder.Sequence> built = encoded.get(index);+ for (int q = 0; q < questionIds.size(); q++) {+ rows.add(new Collator.Item(built.get(q).ids(), built.get(q).markers(),+ asked.get(questionIds.get(q)).type().code()));+ }+ }+ InferenceSession.Output output = session.run(Collator.collate(rows, padId));+ int row = 0;+ for (int index : indices) {+ List<SequenceBuilder.Sequence> built = encoded.get(index);+ out[start + index] = assemble(built, questionIds, asked, output, row,+ language);+ row += questionIds.size();+ }+ }+ }+ return List.of(out);+ }++ /**+ * Builds every question's sequence for one state, tokenizing the state once.+ *+ * <p>Once, not once per question: that is what {@code build_sequence}'s pre-tokenized state+ * parameter exists for, and a document is usually far longer than the question asked about it.+ */+ private List<SequenceBuilder.Sequence> encodeState(Object state, List<String> questionIds,+ Map<String, Question> questions) {int[] stateIds = tokenizer.encode(SequenceBuilder.serializeState(state).replace(maskToken(), " "), -1);-- List<String> ids = new ArrayList<>(questions.keySet());- List<Collator.Item> items = new ArrayList<>(ids.size());- List<SequenceBuilder.Sequence> built = new ArrayList<>(ids.size());- for (String id : ids) {+ List<SequenceBuilder.Sequence> built = new ArrayList<>(questionIds.size());+ for (String id : questionIds) {Question question = questions.get(id);- SequenceBuilder.Sequence sequence = SequenceBuilder.build(- tokenizer, state, question, config.maxLen(), config.headMaxLen(),- null, false, stateIds);+ SequenceBuilder.Sequence sequence = SequenceBuilder.build(tokenizer, state, question,+ config.maxLen(), config.headMaxLen(), null, false, stateIds);+ int defined = question.renderOptions().size();+ if (sequence.markers().length != defined) {+ // Markers sit at absolute positions and the sequence is then cut to `max_len`, so+ // the ones past it are dropped. Answering anyway returns a distribution over the+ // options that happened to survive, with the rest absent from the answer and+ // unchoosable, while `usage.truncated` blames the state instead. Python refuses the+ // request; so does this, naming both knobs because LOWERING `head_max_len` can fix+ // it while raising it makes it worse.+ throw new IllegalArgumentException(String.format(+ "question %s: only %d of its %d option markers fit in max_len=%d with "+ + "head_max_len=%d spent on the question; lower head_max_len, raise "+ + "max_len, or use fewer options",+ id, sequence.markers().length, defined, config.maxLen(),+ config.headMaxLen()));+ }built.add(sequence);- items.add(new Collator.Item(sequence.ids(), sequence.markers(),- question.type().code()));}+ return built;+ }- Collator.Batch batch = Collator.collate(items, padId);- LayaSession.Output output = session.run(batch);-+ private Prediction assemble(List<SequenceBuilder.Sequence> built, List<String> questionIds,+ Map<String, Question> questions, InferenceSession.Output output,+ int firstRow, String language) {Map<String, Answer> answers = new LinkedHashMap<>();- for (int row = 0; row < ids.size(); row++) {- String id = ids.get(row);+ int inputTokens = 0;+ int dropped = 0;+ List<String> truncatedQuestions = new ArrayList<>();+ Map<String, Usage.CollapsedOptions> collapsed = new LinkedHashMap<>();+ for (int q = 0; q < questionIds.size(); q++) {+ String id = questionIds.get(q);+ SequenceBuilder.Sequence sequence = built.get(q);+ int row = firstRow + q;// The FILTERED marker count: a head that overran `max_len` loses markers, and the- // answer must be derived over the options that actually survived into the sequence.- int optionCount = built.get(row).markers().length;- float[] actionProbabilities =- Decoder.actionProbabilities(output.actLogits()[row]);+ // answer must be derived over the options that survived into the sequence.+ int optionCount = sequence.markers().length;+ float[] actionProbabilities = Decoder.actionProbabilities(output.actLogits()[row]);answers.put(id, Decoder.decode(questions.get(id), output.logits()[row], optionCount,actionProbabilities, null, language, config));++ // Every row carries the state, so the state's tokens are counted once per question --+ // which is what the forward pass actually costs.+ inputTokens += sequence.ids().length;+ dropped = Math.max(dropped, sequence.truncation().stateTokensDropped());+ if (sequence.truncation().truncated()) {+ truncatedQuestions.add(id);+ }+ SequenceBuilder.Stats stats = sequence.stats();+ if (stats.optionsDistinct() < stats.options()) {+ collapsed.put(id, new Usage.CollapsedOptions(stats.options(),+ stats.optionsDistinct(), stats.tokensPerOption()));+ }}- return Collections.unmodifiableMap(answers);+ Usage usage = new Usage(inputTokens, 0, built.get(0).truncation().stateTokens(), dropped,+ dropped > 0, List.copyOf(truncatedQuestions),+ Collections.unmodifiableMap(collapsed));+ return new Prediction(Prediction.MODEL, Collections.unmodifiableMap(answers), usage);+ }++ private static int longestRow(List<SequenceBuilder.Sequence> built) {+ int longest = 0;+ for (SequenceBuilder.Sequence sequence : built) {+ longest = Math.max(longest, sequence.ids().length);+ }+ return longest;}private String maskToken() {@@ -145,8 +304,13 @@ public final class Agent implements AutoCloseable {return mask;}+ /** Closes the session. Idempotent, as {@code AutoCloseable} requires. */@Override- public void close() throws OrtException {+ public void close() {+ if (closed) {+ return;+ }+ closed = true;session.close();}}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Prediction.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Prediction.javanew file mode 100644index 00000000..b13cb990--- /dev/null+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Prediction.java@@ -0,0 +1,21 @@+package com.convaiinnovations.laya;++import java.util.Map;++/**+ * One state's answers, with what they cost.+ *+ * @param model the runtime that produced this, matching what Python's ONNX backend reports+ * @param answers the answers, keyed by question id, in the order the questions were asked+ * @param usage token cost and what the budgets dropped; see {@link Usage}+ */+public record Prediction(String model, Map<String, Answer> answers, Usage usage) {++ /** The identifier the Python ONNX backend reports, so a consumer cannot tell them apart. */+ public static final String MODEL = "laya-rl-agent-onnx";++ /** Shorthand for one answer, or null when no question had that id. */+ public Answer answer(String questionId) {+ return answers.get(questionId);+ }+}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Question.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Question.javaindex be8980a2..cf4764bc 100644--- a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Question.java+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Question.java@@ -74,7 +74,7 @@ public final class Question {* values and render as {@code "label: 0"} and {@code "label: false"}.*/public static Question choice(String instructions, Map<String, Object> criteria) {- require(instructions != null, "a question needs instructions");+ requireInstructions(instructions);require(criteria != null && !criteria.isEmpty(), "a choice question needs criteria");return new Question(Type.CHOICE, instructions, new LinkedHashMap<>(criteria), null,null, null);@@ -82,8 +82,15 @@ public final class Question {/** A score over ordered levels, rendered as {@code "level <i>: <criterion>"}. */public static Question score(String instructions, List<Object> levels) {- require(instructions != null, "a question needs instructions");+ requireInstructions(instructions);require(levels != null && !levels.isEmpty(), "a score question needs levels");+ for (int i = 0; i < levels.size(); i++) {+ // A null level rendered as the literal text "level 0: null" into the model's input and+ // came back in the legend as a null value, so the question silently asked about a word+ // the caller never wrote. Python refuses it; so does this.+ require(levels.get(i) != null,+ "score level " + i + " is null; give every level a description, index 0 first");+ }return new Question(Type.SCORE, instructions, null, new ArrayList<>(levels), null, null);}@@ -101,7 +108,7 @@ public final class Question {*/public static Question noul(String instructions, Object falseCriterion, Object trueCriterion,Map<String, String> labels) {- require(instructions != null, "a question needs instructions");+ requireInstructions(instructions);String falseLabel = "false";String trueLabel = "true";if (labels != null) {@@ -222,6 +229,18 @@ public final class Question {return value instanceof String ? (String) value : PythonJson.dumps(value);}+ /**+ * Instructions must be present and not blank.+ *+ * <p>Blank is refused, not just null: an empty or whitespace-only instruction produces the+ * text {@code "choice question: "} and the model is asked nothing, which it answers anyway with+ * a confident-looking distribution over the options. Python refuses the same input.+ */+ private static void requireInstructions(String instructions) {+ require(instructions != null && !instructions.isBlank(),+ "instructions must not be empty; add the text the model should answer");+ }+private static void require(boolean condition, String message) {if (!condition) {throw new IllegalArgumentException(message);diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Usage.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Usage.javanew file mode 100644index 00000000..2e6a896d--- /dev/null+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/Usage.java@@ -0,0 +1,44 @@+package com.convaiinnovations.laya;++import java.util.List;+import java.util.Map;++/**+ * What one prediction cost, and what it silently lost.+ *+ * <p>The second half is the point. A state longer than the room left after the question's head is+ * truncated without an error, and a caller cannot reconstruct that from outside: the budget is in+ * tokens, not characters, and the room left depends on {@code max_len}, {@code head_max_len}, the+ * instruction and the rendered options, so it moves per checkpoint and per question. A caller+ * guessing with a fixed character threshold is wrong in both directions -- it reports truncation+ * that did not happen and stays silent while evidence is being dropped.+ *+ * @param inputTokens non-padding tokens fed to the encoder across every row of this state.+ * The state is re-encoded per question, so a shared document is counted+ * once per question -- which is what it actually costs+ * @param outputTokens always zero: laya is not a generator+ * @param stateTokens tokens the state serialised to, before any budget was applied+ * @param stateTokensDropped the worst case across this state's questions, since they share a+ * state but not a head budget+ * @param truncated whether any question dropped state tokens+ * @param truncatedQuestions the ids of the questions that did+ * @param collapsedOptions questions whose options no longer have a token span each, keyed by+ * question id. Empty unless the head budget collapsed some+ */+public record Usage(int inputTokens, int outputTokens, int stateTokens, int stateTokensDropped,+ boolean truncated, List<String> truncatedQuestions,+ Map<String, Usage.CollapsedOptions> collapsedOptions) {++ /**+ * A question whose options the budget collapsed.+ *+ * @param total how many options the question DEFINES, not how many markers reached+ * the sequence. Counting from markers would report "43 of 58" about a+ * request where 28 options never entered the input at all+ * @param distinct how many still have a token span of their own+ * @param tokensPerOption the cap applied, or null when the collapse came from the 48-token+ * per-option cap rather than the head budget+ */+ public record CollapsedOptions(int total, int distinct, Integer tokensPerOption) {+ }+}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/infer/InferenceException.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/infer/InferenceException.javanew file mode 100644index 00000000..7304de3c--- /dev/null+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/infer/InferenceException.java@@ -0,0 +1,22 @@+package com.convaiinnovations.laya.infer;++/**+ * An inference backend failed.+ *+ * <p>Unchecked, and deliberately not ONNX Runtime's own exception type. A caller asking a question+ * about a document cannot do anything useful about an {@code OrtException} except log it, and+ * making every {@code predict} signature declare one would spread a backend's checked exception+ * across an API that is meant to outlive that backend.+ */+public final class InferenceException extends RuntimeException {++ private static final long serialVersionUID = 1L;++ public InferenceException(String message, Throwable cause) {+ super(message, cause);+ }++ public InferenceException(String message) {+ super(message);+ }+}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/infer/InferenceSession.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/infer/InferenceSession.javanew file mode 100644index 00000000..330385b2--- /dev/null+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/infer/InferenceSession.java@@ -0,0 +1,39 @@+package com.convaiinnovations.laya.infer;++import com.convaiinnovations.laya.sequence.Collator;++/**+ * The seam between the runtime and whatever actually evaluates the graph.+ *+ * <p>An interface rather than the ONNX session directly, for two reasons that both paid for+ * themselves:+ *+ * <ul>+ * <li><b>The batching and usage accounting become testable.</b> Those are the parts most likely+ * to be wrong -- row offsets across states, the filtered marker count, which question gets+ * blamed for a truncation -- and they have nothing to do with ONNX. A stub implementation+ * exercises them in milliseconds, where the real graph is 1.2 GB and would keep them out of+ * any CI that does not download a checkpoint.+ * <li><b>The backend stops leaking.</b> {@code OrtException} is a checked exception from one+ * library; without this seam it appears in the signature of every public {@code predict}+ * method and in every caller's try/catch.+ * </ul>+ *+ * <p>Implementations are not required to be safe for concurrent {@link #run} calls.+ */+public interface InferenceSession extends AutoCloseable {++ /** One batch's head outputs, row-aligned with the batch that produced them. */+ record Output(float[][] logits, float[][] actLogits) {+ }++ /**+ * Evaluates one collated batch.+ *+ * @throws InferenceException if the backend fails+ */+ Output run(Collator.Batch batch);++ @Override+ void close();+}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/json/PythonJson.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/json/PythonJson.javaindex 72a738da..d2dfd9b2 100644--- a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/json/PythonJson.java+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/json/PythonJson.java@@ -4,6 +4,7 @@ import java.math.BigInteger;import java.util.List;import java.util.Locale;import java.util.Map;+import java.util.Set;/*** Serialises a value the way CPython's {@code json.dumps(..., ensure_ascii=False)} does.@@ -39,11 +40,14 @@ public final class PythonJson {/** The compact form: {@code ", "} between items and {@code ": "} after a key. */public static String dumps(Object value) {StringBuilder out = new StringBuilder();- write(out, value);+ // The identity set tracks the containers currently being written, so a cycle is refused+ // rather than recursed into. The state is caller-supplied and a cycle used to arrive as a+ // StackOverflowError -- an Error, which a server's `catch (Exception)` does not contain.+ write(out, value, java.util.Collections.newSetFromMap(new java.util.IdentityHashMap<>()));return out.toString();}- private static void write(StringBuilder out, Object value) {+ private static void write(StringBuilder out, Object value, Set<Object> open) {if (value == null) {out.append("null");} else if (value instanceof String) {@@ -59,9 +63,13 @@ public final class PythonJson {// integer criterion must not be narrowed on the way through.out.append(value.toString());} else if (value instanceof Map) {- writeObject(out, (Map<?, ?>) value);+ enter(open, value);+ writeObject(out, (Map<?, ?>) value, open);+ open.remove(value);} else if (value instanceof List) {- writeArray(out, (List<?>) value);+ enter(open, value);+ writeArray(out, (List<?>) value, open);+ open.remove(value);} else {throw new Json.JsonException("cannot serialise " + value.getClass().getName() + " the way Python's json "@@ -69,7 +77,15 @@ public final class PythonJson {}}- private static void writeObject(StringBuilder out, Map<?, ?> map) {+ /** Refuses a container that is already being written, which is what a cycle looks like. */+ private static void enter(Set<Object> open, Object container) {+ if (!open.add(container)) {+ // CPython's wording, because a caller who hits this is reading both messages.+ throw new Json.JsonException("Circular reference detected");+ }+ }++ private static void writeObject(StringBuilder out, Map<?, ?> map, Set<Object> open) {out.append('{');boolean first = true;for (Map.Entry<?, ?> entry : map.entrySet()) {@@ -77,28 +93,53 @@ public final class PythonJson {out.append(", ");}first = false;- Object key = entry.getKey();- if (!(key instanceof String)) {- // Python coerces int/bool/None keys; laya never produces them, and guessing which- // coercion applied is how a port starts inventing text.- throw new Json.JsonException(- "only string keys are supported, got "- + (key == null ? "null" : key.getClass().getName()));- }- writeString(out, (String) key);+ writeString(out, key(entry.getKey()));out.append(": ");- write(out, entry.getValue());+ write(out, entry.getValue(), open);}out.append('}');}- private static void writeArray(StringBuilder out, List<?> list) {+ /**+ * A mapping key, coerced the way CPython coerces one.+ *+ * <p>CPython writes a non-string key as text rather than refusing it: {@code {1: "x"}} becomes+ * {@code {"1": "x"}}, {@code True} becomes {@code "true"} and {@code None} becomes+ * {@code "null"}. This used to throw instead, on the stated grounds that laya never produces+ * such a key -- which is true of laya and not of the <b>caller-supplied</b> state that reaches+ * here, so a {@code Map<Integer, ?>} state was refused where Python answers.+ *+ * <p>A key CPython itself refuses (a list, a map, an arbitrary object) is still refused here.+ */+ private static String key(Object key) {+ if (key instanceof String) {+ return (String) key;+ }+ if (key == null) {+ return "null";+ }+ if (key instanceof Boolean) {+ return ((Boolean) key) ? "true" : "false";+ }+ if (key instanceof Double || key instanceof Float) {+ return repr(((Number) key).doubleValue());+ }+ if (key instanceof Integer || key instanceof Long || key instanceof Short+ || key instanceof Byte || key instanceof BigInteger) {+ return key.toString();+ }+ throw new Json.JsonException(+ "keys must be a string, a number, a boolean or null, as CPython requires; got "+ + key.getClass().getName());+ }++ private static void writeArray(StringBuilder out, List<?> list, Set<Object> open) {out.append('[');for (int i = 0; i < list.size(); i++) {if (i > 0) {out.append(", ");}- write(out, list.get(i));+ write(out, list.get(i), open);}out.append(']');}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/onnx/LayaSession.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/onnx/LayaSession.javaindex 2189b682..bfa65242 100644--- a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/onnx/LayaSession.java+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/onnx/LayaSession.java@@ -1,9 +1,12 @@package com.convaiinnovations.laya.onnx;import ai.onnxruntime.OnnxTensor;+import ai.onnxruntime.OnnxValue;import ai.onnxruntime.OrtEnvironment;import ai.onnxruntime.OrtException;import ai.onnxruntime.OrtSession;+import com.convaiinnovations.laya.infer.InferenceException;+import com.convaiinnovations.laya.infer.InferenceSession;import com.convaiinnovations.laya.sequence.Collator;import java.io.IOException;import java.nio.file.Files;@@ -12,6 +15,7 @@ import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;+import java.util.Set;/*** The ONNX graph, in either of the two forms laya exports.@@ -29,16 +33,21 @@ import java.util.Map;* caller say. Instances are not thread-safe for concurrent {@code run} calls on one session unless* ONNX Runtime is configured for it; hold one per worker or serialise access.*/-public final class LayaSession implements AutoCloseable {+public final class LayaSession implements InferenceSession {- /** One batch's head outputs. */- public record Output(float[][] logits, float[][] actLogits) {- }+ /**+ * The outputs to ask the graph for.+ *+ * <p>The set only selects WHICH outputs are computed; nothing may depend on its order, and+ * {@link #floats} resolves by name for that reason.+ */+ private static final Set<String> REQUESTED = Set.of("logits", "act_logits");private final OrtEnvironment environment;private final OrtSession fused;private final OrtSession encoder;private final OrtSession head;+ private boolean closed;private LayaSession(OrtEnvironment environment, OrtSession fused, OrtSession encoder,OrtSession head) {@@ -51,28 +60,46 @@ public final class LayaSession implements AutoCloseable {/*** Opens whichever graph form {@code directory} holds, preferring the fused one.*- * @param threads intra-op threads; 1 is the right default for a request-per-thread server,- * where the parallelism is already in the requests+ * @param threads intra-op threads, or <b>0 to let ONNX Runtime decide</b>, which is what the+ * Python runtime does by not setting it. Pinning this to 1 made a single+ * prediction about 3x slower than Python on the same graph -- the forward pass+ * is the whole cost and it was running on one core. Pass 1 deliberately for a+ * request-per-thread server, where the parallelism is already in the requests*/- public static LayaSession open(Path directory, int threads) throws OrtException, IOException {- OrtEnvironment environment = OrtEnvironment.getEnvironment();- OrtSession.SessionOptions options = new OrtSession.SessionOptions();- options.setIntraOpNumThreads(threads);+ public static LayaSession open(Path directory, int threads) throws IOException {Path fusedPath = directory.resolve("laya.onnx");- if (Files.isRegularFile(fusedPath)) {- return new LayaSession(environment,- environment.createSession(fusedPath.toString(), options), null, null);- }Path encoderPath = directory.resolve("encoder.onnx");Path headPath = directory.resolve("head.onnx");- if (Files.isRegularFile(encoderPath) && Files.isRegularFile(headPath)) {+ boolean fusedPresent = Files.isRegularFile(fusedPath);+ boolean splitPresent = Files.isRegularFile(encoderPath) && Files.isRegularFile(headPath);+ if (!fusedPresent && !splitPresent) {+ // An IOException, because this one IS the caller's problem: they pointed at the wrong+ // directory. A backend failure further down is an InferenceException instead.+ throw new IOException(+ "no laya graph in " + directory + ": expected laya.onnx, or encoder.onnx and "+ + "head.onnx");+ }+ OrtEnvironment environment = OrtEnvironment.getEnvironment();+ try {+ OrtSession.SessionOptions options = new OrtSession.SessionOptions();+ if (threads > 0) {+ options.setIntraOpNumThreads(threads);+ }+ // Operator fusion and constant folding. Functionally neutral and free at inference+ // time; without it ONNX Runtime runs the unoptimised graph. The Python runtime sets+ // the same level and records ~1.45x on CPU for it, so omitting it here was a 1.45x+ // regression against the reference for no reason.+ options.setOptimizationLevel(OrtSession.SessionOptions.OptLevel.ALL_OPT);+ if (fusedPresent) {+ return new LayaSession(environment,+ environment.createSession(fusedPath.toString(), options), null, null);+ }return new LayaSession(environment, null,environment.createSession(encoderPath.toString(), options),environment.createSession(headPath.toString(), options));+ } catch (OrtException failure) {+ throw new InferenceException("could not load the laya graph in " + directory, failure);}- throw new IOException(- "no laya graph in " + directory + ": expected laya.onnx, or encoder.onnx and "- + "head.onnx");}/** Whether this session is the fused single-graph form. */@@ -81,7 +108,8 @@ public final class LayaSession implements AutoCloseable {}/** Runs one collated batch. */- public Output run(Collator.Batch batch) throws OrtException {+ @Override+ public Output run(Collator.Batch batch) {List<OnnxTensor> owned = new ArrayList<>();try {OnnxTensor inputIds = track(owned, OnnxTensor.createTensor(environment, batch.inputIds()));@@ -96,15 +124,15 @@ public final class LayaSession implements AutoCloseable {inputs.put("marker_pos", markerPos);inputs.put("marker_mask", markerMask);inputs.put("qtype", qtype);- try (OrtSession.Result result = fused.run(inputs, java.util.Set.of("logits", "act_logits"))) {- return new Output(floats(result, 0), floats(result, 1));+ try (OrtSession.Result result = fused.run(inputs, REQUESTED)) {+ return new Output(floats(result, "logits"), floats(result, "act_logits"));}}Map<String, OnnxTensor> encoderInputs = new HashMap<>();encoderInputs.put("input_ids", inputIds);encoderInputs.put("attention_mask", attention);try (OrtSession.Result encoded = encoder.run(encoderInputs,- java.util.Set.of("last_hidden_state"))) {+ Set.of("last_hidden_state"))) {OnnxTensor hidden = (OnnxTensor) encoded.get(0);Map<String, OnnxTensor> headInputs = new HashMap<>();headInputs.put("hidden_states", hidden);@@ -112,11 +140,14 @@ public final class LayaSession implements AutoCloseable {headInputs.put("marker_mask", markerMask);headInputs.put("qtype", qtype);headInputs.put("attention_mask", attention);- try (OrtSession.Result result = head.run(headInputs,- java.util.Set.of("logits", "act_logits"))) {- return new Output(floats(result, 0), floats(result, 1));+ try (OrtSession.Result result = head.run(headInputs, REQUESTED)) {+ return new Output(floats(result, "logits"), floats(result, "act_logits"));}}+ } catch (OrtException failure) {+ throw new InferenceException(+ "the laya graph failed on a batch of " + batch.rows() + " rows x "+ + batch.length() + " tokens", failure);} finally {for (OnnxTensor tensor : owned) {tensor.close();@@ -129,20 +160,72 @@ public final class LayaSession implements AutoCloseable {return tensor;}- private static float[][] floats(OrtSession.Result result, int index) throws OrtException {- return (float[][]) ((OnnxTensor) result.get(index)).getValue();+ /**+ * One named output, resolved BY NAME.+ *+ * <p>Not by position. {@code OrtSession.Result}'s positional index follows the order of the+ * set of names that was <i>requested</i>, and {@code Set.of} with two or more elements+ * randomises its iteration order per JVM process (its salt is seeded from+ * {@code System.nanoTime()}). Reading {@code get(0)} and {@code get(1)} therefore returned+ * {@code logits} and {@code act_logits} in one process and swapped them in the next --+ * measured at 4 and 6 out of 10 fresh JVMs.+ *+ * <p>That was silent wherever every question in the batch had exactly two options, which is+ * every {@code noul} and any two-option choice: both outputs are then two columns wide, so no+ * shape check could notice, and the answer simply inverted. On the real graph it turned "the+ * customer was charged more than once" from true at 0.9972 into false at confidence 1.0000.+ * The Python runtime is immune because it passes an ordered list, not a set.+ */+ private static float[][] floats(OrtSession.Result result, String name) throws OrtException {+ OnnxValue value = result.get(name).orElseThrow(() -> new InferenceException(+ "the laya graph produced no output named " + name));+ if (!(value instanceof OnnxTensor)) {+ throw new InferenceException(+ "the laya graph's " + name + " output is not a tensor but a "+ + value.getClass().getSimpleName());+ }+ return (float[][]) ((OnnxTensor) value).getValue();+ }++ /** Whether this session has been closed, so a caller gets an API error, not a backend one. */+ public boolean isClosed() {+ return closed;}+ /**+ * Closes every session this holds.+ *+ * <p>Idempotent, because {@code AutoCloseable} says so and because try-with-resources plus an+ * explicit {@code close()} is ordinary code -- ONNX Runtime itself throws+ * "Trying to close an already closed OrtSession" on the second call.+ *+ * <p>Every session is closed even when one of them throws: in the split form a failure closing+ * the encoder used to leave the head open, leaking native memory for the life of the process.+ * The first failure is reported and the rest are attached to it.+ */@Override- public void close() throws OrtException {- if (fused != null) {- fused.close();+ public void close() {+ if (closed) {+ return;}- if (encoder != null) {- encoder.close();+ closed = true;+ InferenceException failure = null;+ for (OrtSession session : new OrtSession[] {fused, encoder, head}) {+ if (session == null) {+ continue;+ }+ try {+ session.close();+ } catch (OrtException | RuntimeException problem) {+ if (failure == null) {+ failure = new InferenceException("closing the laya graph failed", problem);+ } else {+ failure.addSuppressed(problem);+ }+ }}- if (head != null) {- head.close();+ if (failure != null) {+ throw failure;}}}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/sequence/SequenceBuilder.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/sequence/SequenceBuilder.javaindex 9bf2184a..811859b1 100644--- a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/sequence/SequenceBuilder.java+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/sequence/SequenceBuilder.java@@ -209,7 +209,13 @@ public final class SequenceBuilder {new Stats(optionIds.size(), distinct.size(), tokensPerOption));}- /** The state as text: a String passes through, anything else becomes Python-compatible JSON. */+ /**+ * The state as text: a String passes through, anything else becomes Python-compatible JSON.+ *+ * <p>A null state is not an error: Python's {@code serialize_state} hands {@code None} to+ * {@code json.dumps}, which writes the four characters {@code null}, and the model is asked+ * about that. Reproduced rather than refused, so the two runtimes answer the same question.+ */public static String serializeState(Object state) {return state instanceof String ? (String) state : PythonJson.dumps(state);}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/AddedVocabulary.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/AddedVocabulary.javaindex 36e938e8..c28d394c 100644--- a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/AddedVocabulary.java+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/AddedVocabulary.java@@ -85,12 +85,12 @@ final class AddedVocabulary {if (hit.lstrip()) {// Absorb whitespace to the left, but never back past text already emitted: a// previous added token's span is settled and must not be swallowed.- while (start > plainFrom && Character.isWhitespace(text.charAt(start - 1))) {+ while (start > plainFrom && Unicode.isWhiteSpace(text.charAt(start - 1))) {start--;}}if (hit.rstrip()) {- while (stop < text.length() && Character.isWhitespace(text.charAt(stop))) {+ while (stop < text.length() && Unicode.isWhiteSpace(text.charAt(stop))) {stop++;}}@@ -134,8 +134,8 @@ final class AddedVocabulary {* that did set it would otherwise be tokenized wrongly with no signal at all.*/private static boolean standsAlone(String text, int start, int stop) {- boolean leftClear = start == 0 || !Character.isLetterOrDigit(text.charAt(start - 1));- boolean rightClear = stop >= text.length() || !Character.isLetterOrDigit(text.charAt(stop));+ boolean leftClear = start == 0 || !Unicode.isAlphanumeric(text.charAt(start - 1));+ boolean rightClear = stop >= text.length() || !Unicode.isAlphanumeric(text.charAt(stop));return leftClear && rightClear;}}diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Bpe.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Bpe.javaindex b3f7e3f0..6617e180 100644--- a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Bpe.java+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Bpe.java@@ -16,11 +16,19 @@ import java.util.Map;* identical ids on the majority -- the worst failure shape there is: a parity suite that passes on* prose and diverges on a customer's data.*- * <p>Complexity: each pass over a piece of {@code k} symbols costs O(k) lookups and each merge- * removes one symbol, so a piece costs O(k²) lookups worst case. Pieces are words, not documents,- * so the quadratic term is bounded by the longest word. {@code laya-ts} hit exactly this shape and- * fixed it upstream (5.5 s to 3 ms at 16k characters), which is why the per-pass scan stays over a- * flat list rather than rebuilding structures per merge.+ * <p><b>Complexity.</b> Done the obvious way -- rescan every adjacent pair, merge the best, repeat+ * -- a piece of {@code k} symbols costs O(k²) lookups. That is fine for words and ruinous for the+ * long unspaced runs real text contains: on a corpus with a 2,000-character run and a+ * 1,000-character CJK run it measured <b>24.5 ms</b> against {@code laya-ts}'s 1.4 ms, a 17x+ * regression against another SDK of the same model. {@code laya-ts} had the same shape and fixed+ * it; this is the same fix.+ *+ * <p>So there are two routes to one rule. Short pieces take the rescan, which allocates nothing and+ * costs one pass. Long pieces take a min-heap of candidate pairs over a doubly-linked list of+ * surviving slots, which makes merge SELECTION O(log k) and the piece O(k log k). A heap entry is+ * never removed when it goes stale -- it carries the slot's version and is discarded on the way+ * out -- because deleting from the middle of a heap costs more than skipping on pop.+ * {@code test_bpe_routes_agree} sweeps the two against each other so they cannot drift apart.*/final class Bpe {@@ -112,6 +120,15 @@ final class Bpe {return ids;}+ /**+ * Pieces at or above this many symbols go through the heap instead of the rescan.+ *+ * <p>A threshold, because the heap's setup -- four int arrays and a linked list -- costs more+ * than a rescan of a short word, and most pieces a pre-tokenizer emits are short words. The+ * value is measured, not guessed: see the throughput figures in the class note.+ */+ static final int HEAP_MIN_LENGTH = 32;+/** Token ids for one pre-tokenized piece, appended to {@code out}. */void encodePiece(String piece, List<Integer> out) {if (piece.isEmpty()) {@@ -133,18 +150,22 @@ final class Bpe {}List<String> symbols = initialSymbols(piece);- mergeAll(symbols);+ if (symbols.size() >= HEAP_MIN_LENGTH) {+ mergeWithHeap(symbols);+ } else {+ mergeByRescan(symbols);+ }emit(symbols, out);}/**- * Applies merges to {@code symbols} in place, lowest rank first, re-scanning after each.+ * Applies merges in place, lowest rank first, re-scanning after each. For short pieces.** <p>Re-scanning is not an optimisation choice: merging a pair creates a new symbol whose* neighbours may form a <i>lower</i>-ranked pair than anything that existed before, and a* single left-to-right pass would miss it.*/- private void mergeAll(List<String> symbols) {+ void mergeByRescan(List<String> symbols) {while (symbols.size() > 1) {int bestRank = Integer.MAX_VALUE;int bestIndex = -1;@@ -171,6 +192,180 @@ final class Bpe {}}+ /**+ * The same rule in O(k log k): pairs chosen from a min-heap over a linked list of the slots.+ *+ * <p>The result is identical to {@link #mergeByRescan} -- same rule, same tie-breaking (the+ * heap orders on rank then on slot, so the leftmost of two equal-ranked pairs wins, which is+ * what a left-to-right rescan picks). Only the cost differs.+ */+ void mergeWithHeap(List<String> symbols) {+ int n = symbols.size();+ if (n <= 1) {+ return;+ }+ String[] token = symbols.toArray(new String[0]);+ int[] next = new int[n];+ int[] previous = new int[n];+ int[] version = new int[n];+ boolean[] dead = new boolean[n];+ for (int i = 0; i < n; i++) {+ previous[i] = i - 1;+ next[i] = i + 1 < n ? i + 1 : -1;+ }+ // 3n is a bound, not a hope: at most n-1 pairs are offered up front, every merge kills+ // exactly one slot so there are at most n-1 merges, and each offers at most two pairs.+ PairHeap heap = new PairHeap(3 * n);+ for (int i = 0; i < n; i++) {+ offer(heap, token, next, version, i);+ }+ while (heap.size > 0) {+ int slot = heap.peekSlot();+ int seen = heap.peekVersion();+ heap.pop();+ // Stale entries are skipped on the way out rather than deleted on the way in: a slot+ // that has since merged or died has a different version, and removing from the middle+ // of a heap costs more than discarding here.+ if (dead[slot] || version[slot] != seen) {+ continue;+ }+ int right = next[slot];+ if (right < 0 || dead[right]) {+ continue;+ }+ token[slot] = token[slot] + token[right];+ dead[right] = true;+ next[slot] = next[right];+ if (next[right] >= 0) {+ previous[next[right]] = slot;+ }+ version[slot]++;+ offer(heap, token, next, version, slot);+ int left = previous[slot];+ if (left >= 0) {+ // The left neighbour's version must be bumped too, not just re-offered. Its old+ // heap entry still names this slot as its right-hand side, and that symbol has+ // just changed -- so the entry carries a rank for a pair that no longer exists.+ // Without this increment the stale entry still looks current, gets popped, and+ // merges at the wrong point in the order: one corpus entry out of forty came out+ // different from the rescan, which is how this was caught.+ version[left]++;+ offer(heap, token, next, version, left);+ }+ }+ symbols.clear();+ for (int i = 0; i >= 0 && i < n; i = next[i]) {+ if (!dead[i]) {+ symbols.add(token[i]);+ }+ }+ }++ /** Offers the pair starting at {@code slot}, when it has a right neighbour and a rank. */+ private void offer(PairHeap heap, String[] token, int[] next, int[] version, int slot) {+ int right = next[slot];+ if (right < 0) {+ return;+ }+ Map<String, Integer> fromLeft = merges.get(token[slot]);+ if (fromLeft == null) {+ return;+ }+ Integer rank = fromLeft.get(token[right]);+ if (rank == null) {+ return;+ }+ heap.push(rank, slot, version[slot]);+ }++ /**+ * A min-heap of candidate pairs, ordered by merge rank and then by slot.+ *+ * <p>Three parallel {@code int} arrays rather than objects, so a push allocates nothing. The+ * secondary ordering on slot is not cosmetic: it is what makes the heap pick the same pair a+ * left-to-right rescan picks when two pairs share a rank.+ */+ private static final class PairHeap {++ private int[] rank;+ private int[] slot;+ private int[] version;+ private int size;++ PairHeap(int capacity) {+ int initial = Math.max(8, capacity);+ rank = new int[initial];+ slot = new int[initial];+ version = new int[initial];+ }++ void push(int pairRank, int pairSlot, int pairVersion) {+ if (size == rank.length) {+ // The 3n bound is a proof, but an out-of-bounds write here would be a wrong token+ // rather than an error, so the growth stays.+ rank = java.util.Arrays.copyOf(rank, size * 2);+ slot = java.util.Arrays.copyOf(slot, size * 2);+ version = java.util.Arrays.copyOf(version, size * 2);+ }+ int child = size++;+ while (child > 0) {+ int parent = (child - 1) >>> 1;+ if (less(rank[parent], slot[parent], pairRank, pairSlot)) {+ break;+ }+ rank[child] = rank[parent];+ slot[child] = slot[parent];+ version[child] = version[parent];+ child = parent;+ }+ rank[child] = pairRank;+ slot[child] = pairSlot;+ version[child] = pairVersion;+ }++ int peekSlot() {+ return slot[0];+ }++ int peekVersion() {+ return version[0];+ }++ void pop() {+ size--;+ if (size == 0) {+ return;+ }+ int movedRank = rank[size];+ int movedSlot = slot[size];+ int movedVersion = version[size];+ int hole = 0;+ while (true) {+ int left = hole * 2 + 1;+ if (left >= size) {+ break;+ }+ int child = left + 1 < size+ && less(rank[left + 1], slot[left + 1], rank[left], slot[left])+ ? left + 1 : left;+ if (less(movedRank, movedSlot, rank[child], slot[child])) {+ break;+ }+ rank[hole] = rank[child];+ slot[hole] = slot[child];+ version[hole] = version[child];+ hole = child;+ }+ rank[hole] = movedRank;+ slot[hole] = movedSlot;+ version[hole] = movedVersion;+ }++ private static boolean less(int rankA, int slotA, int rankB, int slotB) {+ return rankA != rankB ? rankA < rankB : slotA < slotB;+ }+ }+/*** Resolves merged symbols to ids: vocabulary entry, else the UTF-8 byte tokens, else unknown.*diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Normalizer.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Normalizer.javaindex 95eaca76..d3ba5437 100644--- a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Normalizer.java+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Normalizer.java@@ -125,10 +125,10 @@ abstract class Normalizer {private static String strip(String text, boolean left, boolean right) {int from = 0;int to = text.length();- while (left && from < to && Character.isWhitespace(text.charAt(from))) {+ while (left && from < to && Unicode.isWhiteSpace(text.charAt(from))) {from++;}- while (right && to > from && Character.isWhitespace(text.charAt(to - 1))) {+ while (right && to > from && Unicode.isWhiteSpace(text.charAt(to - 1))) {to--;}return text.substring(from, to);diff --git a/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Unicode.java b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Unicode.javanew file mode 100644index 00000000..10c29cd9--- /dev/null+++ b/laya-java/laya-java/src/main/java/com/convaiinnovations/laya/tokenizer/Unicode.java@@ -0,0 +1,66 @@+package com.convaiinnovations.laya.tokenizer;++/**+ * The two character predicates the reference tokenizer uses, which Java's built-ins do not match.+ *+ * <p>The reference implementation is Rust, and {@code char::is_whitespace} there is the Unicode+ * <b>White_Space</b> property. {@link Character#isWhitespace} is not that property: it excludes the+ * non-breaking spaces {@code U+00A0}, {@code U+2007} and {@code U+202F} and the next-line+ * {@code U+0085}, and it includes the file/group/record/unit separators {@code U+001C}-{@code+ * U+001F} which White_Space does not.+ *+ * <p>Eight characters disagree, and they are reachable: an added token with {@code lstrip} absorbs+ * whitespace to its left, so {@code "a" + U+00A0 + "[MASK]"} tokenized to three ids here where the+ * reference gives two, and {@code "a" + U+001C + "[MASK]"} to two where the reference gives three.+ */+final class Unicode {++ private Unicode() {+ }++ /**+ * The Unicode {@code White_Space} property, which is what the reference tokenizer strips.+ *+ * <p>Spelled out rather than derived from a Java predicate, because no Java predicate is this+ * set: {@link Character#isSpaceChar} is the Z categories only (it misses the tab and newline+ * range) and {@link Character#isWhitespace} differs as described above. The set is small,+ * fixed by the Unicode standard, and this way it can be read against the standard.+ */+ static boolean isWhiteSpace(char c) {+ switch (c) {+ case '\t': // U+0009 .. U+000D+ case '\n':+ case 0x000B:+ case '\f':+ case '\r':+ case ' ': // U+0020+ case 0x0085: // NEXT LINE+ case 0x00A0: // NO-BREAK SPACE+ case 0x1680: // OGHAM SPACE MARK+ case 0x2028: // LINE SEPARATOR+ case 0x2029: // PARAGRAPH SEPARATOR+ case 0x202F: // NARROW NO-BREAK SPACE+ case 0x205F: // MEDIUM MATHEMATICAL SPACE+ case 0x3000: // IDEOGRAPHIC SPACE+ return true;+ default:+ return c >= 0x2000 && c <= 0x200A; // EN QUAD .. HAIR SPACE+ }+ }++ /**+ * Rust's {@code char::is_alphanumeric}: the Unicode {@code Alphabetic} property, or a number.+ *+ * <p>{@link Character#isLetterOrDigit} is narrower -- it misses the other-numeric category, so+ * a superscript or a fraction counts as a word character to the reference and not to Java.+ * This only affects an added token with {@code single_word}, which neither shipped checkpoint+ * sets, so it is correctness kept rather than a bug fixed.+ */+ static boolean isAlphanumeric(char c) {+ if (Character.isAlphabetic(c)) {+ return true; // L*, Nl and Other_Alphabetic+ }+ int type = Character.getType(c);+ return type == Character.DECIMAL_DIGIT_NUMBER || type == Character.OTHER_NUMBER;+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/AgentBatchingTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/AgentBatchingTest.javanew file mode 100644index 00000000..cc14599d--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/AgentBatchingTest.java@@ -0,0 +1,277 @@+package com.convaiinnovations.laya;++import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertFalse;+import static org.junit.jupiter.api.Assertions.assertIterableEquals;+import static org.junit.jupiter.api.Assertions.assertThrows;+import static org.junit.jupiter.api.Assertions.assertTrue;++import java.io.IOException;+import java.nio.file.Path;+import java.util.ArrayList;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;+import org.junit.jupiter.api.io.TempDir;++/**+ * Batching, row offsets, usage accounting and result ordering, over a synthetic checkpoint.+ *+ * <p>These are the parts most likely to be wrong and least related to inference, so they are tested+ * without a model. The real-model end-to-end run covers the same ground against Python, but only+ * where a 1.2 GB graph is available.+ */+final class AgentBatchingTest {++ private static Map<String, Question> twoQuestions() {+ Map<String, Question> questions = new LinkedHashMap<>();+ questions.put("intent", Question.choice("What next?",+ TinyCheckpoint.ordered("refund", "money back", "escalate", "a human")));+ questions.put("urgent", Question.noul("Needs a human."));+ return questions;+ }++ @Test+ @DisplayName("every batch size and sort order gives the same answers, in the caller's order")+ void batchingDoesNotChangeAnswersOrOrder(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 128, 48);+ List<Object> states = List.of("alpha", "a much longer state than the others here",+ "beta", "", "gamma gamma gamma", "d");+ Map<String, Question> questions = twoQuestions();++ List<String> reference = null;+ for (int batchSize : new int[] {0, 1, 2, 3, 4, 7}) {+ for (boolean sort : new boolean[] {false, true}) {+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ List<Prediction> got =+ agent.predictBatch(states, questions, null, batchSize, sort);+ assertEquals(states.size(), got.size(),+ "one prediction per state at batchSize=" + batchSize);+ List<String> rendered = new ArrayList<>();+ for (Prediction prediction : got) {+ assertIterableEquals(questions.keySet(), prediction.answers().keySet(),+ "answers keyed by question id, in order");+ rendered.add(prediction.answers().toString() + prediction.usage());+ }+ if (reference == null) {+ reference = rendered;+ } else {+ // Grouping is a performance choice; it must not be observable in a result.+ assertEquals(reference, rendered,+ "batchSize=" + batchSize + " sort=" + sort + " changed a result");+ }+ }+ }+ }+ }++ @Test+ @DisplayName("a batch size bounds the rows per graph call")+ void batchSizeBoundsRowsPerCall(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 128, 48);+ List<Object> states = List.of("a", "b", "c", "d", "e");+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ agent.predictBatch(states, twoQuestions(), null, 2, false);+ // 5 states x 2 questions = 10 rows, at most 2 states (4 rows) per call+ assertEquals(3, session.batches.size(), "ceil(5 / 2) calls");+ for (var batch : session.batches) {+ assertTrue(batch.rows() <= 4, "rows per call: " + batch.rows());+ }+ int total = session.batches.stream().mapToInt(b -> b.rows()).sum();+ assertEquals(10, total);+ }+ }++ @Test+ @DisplayName("usage counts the state once per question, because each row carries it")+ void usageCountsStatePerRow(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 512, 128);+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ Prediction one = agent.predict("hello", twoQuestions());+ Usage usage = one.usage();+ assertEquals(0, usage.outputTokens(), "laya is not a generator");+ assertEquals(5, usage.stateTokens(), "one token per UTF-8 byte of \"hello\"");+ assertFalse(usage.truncated());+ assertTrue(usage.truncatedQuestions().isEmpty());+ assertTrue(usage.collapsedOptions().isEmpty());+ // Both rows embed the state, so input_tokens exceeds the state's own length.+ assertTrue(usage.inputTokens() > usage.stateTokens(),+ "inputTokens=" + usage.inputTokens() + " stateTokens=" + usage.stateTokens());+ int rows = session.batches.get(0).rows();+ assertEquals(2, rows);+ }+ }++ @Test+ @DisplayName("a state that does not fit reports what was dropped, and which questions dropped it")+ void truncationIsReported(@TempDir Path root) throws IOException {+ // A tiny budget so the state cannot fit: the report is the only way a caller can tell.+ TinyCheckpoint.write(root, 40, 24);+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ Prediction one = agent.predict("x".repeat(500), twoQuestions());+ Usage usage = one.usage();+ assertEquals(500, usage.stateTokens());+ assertTrue(usage.truncated());+ assertTrue(usage.stateTokensDropped() > 400, "dropped " + usage.stateTokensDropped());+ assertIterableEquals(List.of("intent", "urgent"), usage.truncatedQuestions());+ }+ }++ @Test+ @DisplayName("options collapsed by the budget are reported with the count the question DEFINES")+ void collapsedOptionsAreReported(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 256, 32);+ Map<String, Question> questions = new LinkedHashMap<>();+ // Options identical for far longer than the per-option cap, so the cap collapses them.+ Map<String, Object> criteria = new LinkedHashMap<>();+ criteria.put("prefix ".repeat(40) + "one", "d");+ criteria.put("prefix ".repeat(40) + "two", "d");+ questions.put("pick", Question.choice("Pick.", criteria));+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ Usage usage = agent.predict("s", questions).usage();+ Usage.CollapsedOptions collapsed = usage.collapsedOptions().get("pick");+ org.junit.jupiter.api.Assertions.assertNotNull(collapsed,+ "a collapse must be reported: " + usage.collapsedOptions());+ assertEquals(2, collapsed.total(), "the count the question DEFINES");+ assertEquals(1, collapsed.distinct(), "both options became the same token span");+ }+ }++ @Test+ @DisplayName("the row decoded for a question is that question's own row")+ void rowOffsetsLineUp(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 128, 48);+ // The stub's logits encode the row index, and they rise with the slot, so the argmax is+ // the LAST option of each question. A row offset that slipped would change the answer.+ Map<String, Question> questions = new LinkedHashMap<>();+ questions.put("a", Question.choice("A?", TinyCheckpoint.ordered("x", "1", "y", "2")));+ questions.put("b", Question.choice("B?", TinyCheckpoint.ordered("p", "1", "q", "2", "r", "3")));+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ Map<String, Answer> answers = agent.predict("s", questions).answers();+ assertEquals("y", ((Answer.Choice) answers.get("a")).choice());+ assertEquals("r", ((Answer.Choice) answers.get("b")).choice());+ // act_probability comes from the row's own act logits, which differ per row+ assertTrue(answers.get("a").actProbability() != answers.get("b").actProbability(),+ "each question must read its own action row");+ }+ }++ @Test+ @DisplayName("no questions is refused, and no states is an empty result rather than a call")+ void degenerateInputs(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 128, 48);+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ assertThrows(IllegalArgumentException.class,+ () -> agent.predict("s", new LinkedHashMap<>()));+ assertTrue(agent.predictBatch(List.of(), twoQuestions()).isEmpty());+ assertTrue(session.batches.isEmpty(), "an empty batch must not reach the graph");+ }+ }++ @Test+ @DisplayName("a question whose markers do not all fit is refused, not answered partially")+ void markerOverflowIsRefused(@TempDir Path root) throws IOException {+ // Markers sit at absolute positions and the sequence is cut to max_len, so with enough+ // options the later ones fall off. Answering anyway returns a distribution over the+ // survivors, with the rest absent from the answer and unchoosable -- and usage.truncated+ // would blame the state. Python refuses the request.+ TinyCheckpoint.write(root, 48, 200);+ Map<String, Object> criteria = new LinkedHashMap<>();+ for (int i = 0; i < 30; i++) {+ criteria.put("label" + i, "description number " + i);+ }+ Map<String, Question> questions = new LinkedHashMap<>();+ questions.put("topic", Question.choice("Pick one.", criteria));+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ IllegalArgumentException refused = assertThrows(IllegalArgumentException.class,+ () -> agent.predict("s", questions));+ String message = refused.getMessage();+ assertTrue(message.contains("option markers fit"), message);+ assertTrue(message.contains("of its 30 option markers"), message);+ // Both knobs are named: LOWERING head_max_len can fix it, raising it makes it worse.+ assertTrue(message.contains("head_max_len") && message.contains("max_len"), message);+ assertTrue(session.batches.isEmpty(), "the graph must not be called at all");+ }+ }++ @Test+ @DisplayName("mutating the questions map during a call cannot relabel an answer")+ void questionsAreSnapshotted(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 128, 48);+ Map<String, Question> questions = new LinkedHashMap<>();+ questions.put("intent", Question.choice("What next?",+ TinyCheckpoint.ordered("refund", "money back", "escalate", "a human")));+ // A session that swaps the caller's map while the graph is "running": the sequences are+ // already built, and the answers are labelled afterwards. Reading the map twice let one+ // question's labels land on another question's logits, with no exception.+ InferenceSwappingSession session = new InferenceSwappingSession(questions);+ try (Agent agent = TinyCheckpoint.agent(root, session)) {+ Map<String, Answer> answers = agent.predict("s", questions).answers();+ Answer.Choice choice = (Answer.Choice) answers.get("intent");+ assertIterableEquals(List.of("refund", "escalate"), choice.probabilities().keySet(),+ "the answer must carry the labels of the question that was actually encoded");+ }+ }++ /** Swaps the caller's questions map mid-call, to prove the runtime snapshotted it. */+ private static final class InferenceSwappingSession extends TinyCheckpoint.RecordingSession {+ private final Map<String, Question> victim;++ InferenceSwappingSession(Map<String, Question> victim) {+ this.victim = victim;+ }++ @Override+ public Output run(com.convaiinnovations.laya.sequence.Collator.Batch batch) {+ victim.put("intent", Question.choice("Different question.",+ TinyCheckpoint.ordered("APPROVE_WIRE", "x", "HOLD_WIRE", "y")));+ return super.run(batch);+ }+ }++ @Test+ @DisplayName("using an agent after closing it is an API error, not a backend one")+ void useAfterCloseIsAnApiError(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 128, 48);+ TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session);+ agent.close();+ IllegalStateException refused = assertThrows(IllegalStateException.class,+ () -> agent.predict("s", twoQuestions()));+ assertTrue(refused.getMessage().contains("closed"), refused.getMessage());+ }++ @Test+ @DisplayName("a null state is answered, as Python answers it")+ void nullStateIsAnswered(@TempDir Path root) throws IOException {+ // Python's serialize_state hands None to json.dumps, which writes "null", and the model is+ // asked about that. `List.of` used to reject it with a bare NullPointerException.+ TinyCheckpoint.write(root, 128, 48);+ try (TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session)) {+ Prediction got = agent.predict(null, twoQuestions());+ assertEquals(4, got.usage().stateTokens(), "the four characters of \"null\"");+ }+ }++ @Test+ @DisplayName("closing the agent closes the session, and closing twice is safe")+ void closeIsIdempotent(@TempDir Path root) throws IOException {+ TinyCheckpoint.write(root, 128, 48);+ TinyCheckpoint.RecordingSession session = new TinyCheckpoint.RecordingSession();+ Agent agent = TinyCheckpoint.agent(root, session);+ agent.close();+ assertTrue(session.closed);+ agent.close();+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/Fixtures.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/Fixtures.javanew file mode 100644index 00000000..2bb05820--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/Fixtures.java@@ -0,0 +1,99 @@+package com.convaiinnovations.laya;++import com.convaiinnovations.laya.json.Json;+import java.io.BufferedReader;+import java.io.IOException;+import java.io.Reader;+import java.io.UncheckedIOException;+import java.nio.charset.StandardCharsets;+import java.nio.file.Files;+import java.nio.file.Path;+import java.nio.file.Paths;+import java.util.List;+import java.util.Map;++/**+ * Locates the generated parity fixtures and the optional real checkpoints.+ *+ * <p>The fixtures are committed and are the gate that needs nothing but this repository. The+ * checkpoints are not: a test that needs one announces that and is skipped, rather than passing+ * vacuously when the model is absent. A skipped parity test is not a green parity test, which is+ * why CI asserts a minimum passed count as well as a zero failure count.+ */+public final class Fixtures {++ /** Set to the directory holding {@code english/} and {@code multilingual/} to enable those tests. */+ public static final String CHECKPOINTS_ENV = "LAYA_CHECKPOINTS";++ /** Set to the directory holding {@code laya.onnx} (or {@code encoder.onnx} + {@code head.onnx}). */+ public static final String GRAPH_ENV = "LAYA_ONNX_GRAPH";++ /** Set to a {@code predict.json} recorded from Python with a graph present. */+ public static final String PREDICT_GOLDEN_ENV = "LAYA_PREDICT_GOLDEN";++ private Fixtures() {+ }++ /** The {@code laya-java/fixtures} directory, found by walking up from the working directory. */+ public static Path directory() {+ Path here = Paths.get("").toAbsolutePath();+ for (Path candidate = here; candidate != null; candidate = candidate.getParent()) {+ Path fixtures = candidate.resolve("fixtures");+ if (Files.isDirectory(fixtures) && Files.isRegularFile(fixtures.resolve("decode.json"))) {+ return fixtures;+ }+ }+ throw new IllegalStateException(+ "no laya-java/fixtures directory above " + here+ + "; run `python scripts/gen_fixtures.py` from laya-java");+ }++ /** One fixture family, parsed. */+ @SuppressWarnings("unchecked")+ public static Map<String, Object> load(String name) {+ Path path = directory().resolve(name);+ try (Reader reader = new BufferedReader(+ Files.newBufferedReader(path, StandardCharsets.UTF_8), 1 << 16)) {+ return (Map<String, Object>) Json.parse(reader);+ } catch (IOException failure) {+ throw new UncheckedIOException("cannot read fixture " + path, failure);+ }+ }++ /** The checkpoint root, or null when {@link #CHECKPOINTS_ENV} is unset or wrong. */+ public static Path checkpoints() {+ String configured = System.getenv(CHECKPOINTS_ENV);+ if (configured == null || configured.isBlank()) {+ return null;+ }+ Path root = Paths.get(configured);+ return Files.isDirectory(root) ? root : null;+ }++ /** Whether this checkpoint is present under the configured root. */+ public static Path checkpoint(String name) {+ Path root = checkpoints();+ if (root == null) {+ return null;+ }+ Path model = root.resolve(name);+ return Files.isRegularFile(model.resolve("rl_agent_config.json")) ? model : null;+ }++ /** The message a skipped checkpoint test prints, so the reason is actionable. */+ public static String missingCheckpoint(String name) {+ return "needs the " + name + " checkpoint: set " + CHECKPOINTS_ENV+ + " to the directory holding english/ and multilingual/";+ }++ /** Helper: a list of longs from a fixture array. */+ @SuppressWarnings("unchecked")+ public static int[] ints(Object value) {+ List<Object> items = (List<Object>) value;+ int[] out = new int[items.size()];+ for (int i = 0; i < out.length; i++) {+ out[i] = ((Number) items.get(i)).intValue();+ }+ return out;+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/PredictParityTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/PredictParityTest.javanew file mode 100644index 00000000..7abacf8a--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/PredictParityTest.java@@ -0,0 +1,255 @@+package com.convaiinnovations.laya;++import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertIterableEquals;+import static org.junit.jupiter.api.Assertions.assertTrue;++import java.io.IOException;+import java.nio.file.Files;+import java.nio.file.Path;+import java.nio.file.Paths;+import java.util.ArrayList;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;+import org.junit.jupiter.api.AfterAll;+import org.junit.jupiter.api.Assumptions;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.DynamicTest;+import org.junit.jupiter.api.TestFactory;++/**+ * End to end on a real graph: the Java runtime must answer what Python's {@code ONNXAgent} answered.+ *+ * <p>The only check that covers the whole stack at once -- tokenizer, sequence budgets, collation,+ * graph I/O, decode, rounding and usage -- which the fixture families cannot do individually.+ *+ * <p><b>Tolerance.</b> Structure is compared exactly: the answer type, the chosen label, the+ * question ids and their order, the legend, and every integer in {@link Usage}. Probabilities are+ * compared within {@value #PROBABILITY_TOLERANCE}, two units in the last reported decimal, because+ * the encoder's own arithmetic is platform-sensitive and the golden is recorded on one machine. A+ * chosen label is only asserted when the top two probabilities are clear of that tolerance; when+ * they are not, the argmax is genuinely a coin toss and asserting it would be asserting noise.+ */+final class PredictParityTest {++ /** Two units in the last decimal an answer reports. */+ private static final double PROBABILITY_TOLERANCE = 2e-4;++ /**+ * One agent for the whole class, closed when the class is done.+ *+ * <p>Opening it per factory loaded the 1.2 GB graph twice and doubled the parity lane's+ * wall-clock for no coverage. {@code @AutoClose} ties it to the class lifecycle rather than+ * leaking the native session for the rest of the JVM.+ */+ private static Agent shared;++ @AfterAll+ static void closeAgent() {+ if (shared != null) {+ shared.close();+ shared = null;+ }+ }++ @TestFactory+ @DisplayName("single-state predictions match Python")+ @SuppressWarnings("unchecked")+ List<DynamicTest> singleMatches() throws IOException {+ Map<String, Object> golden = requireGolden();+ Map<String, Object> singles = (Map<String, Object>) golden.get("single");+ List<DynamicTest> tests = new ArrayList<>();+ Agent agent = agent(golden);+ for (Map.Entry<String, Object> entry : singles.entrySet()) {+ Map<String, Object> c = (Map<String, Object>) entry.getValue();+ tests.add(DynamicTest.dynamicTest(entry.getKey(), () -> {+ Prediction got = agent.predict(c.get("state"),+ questionsOf((Map<String, Object>) c.get("questions")),+ (String) c.get("lang"));+ assertEquals(c.get("model"), got.model());+ assertAnswers((Map<String, Object>) c.get("answers"), got.answers());+ assertUsage((Map<String, Object>) c.get("usage"), got.usage());+ }));+ }+ assertTrue(tests.size() >= 5, "expected the golden's cases, got " + tests.size());+ return tests;+ }++ @TestFactory+ @DisplayName("batched predictions match Python at every batch size and sort order")+ @SuppressWarnings("unchecked")+ List<DynamicTest> batchMatches() throws IOException {+ Map<String, Object> golden = requireGolden();+ Agent agent = agent(golden);+ List<DynamicTest> tests = new ArrayList<>();+ for (Object configObject : (List<Object>) golden.get("batch")) {+ Map<String, Object> config = (Map<String, Object>) configObject;+ Object size = config.get("batch_size");+ boolean sort = Boolean.TRUE.equals(config.get("sort_by_length"));+ tests.add(DynamicTest.dynamicTest(+ "batch_size=" + (size == null ? "all" : size) + " sort=" + sort, () -> {+ List<Prediction> got = agent.predictBatch(+ (List<Object>) config.get("states"),+ questionsOf((Map<String, Object>) config.get("questions")),+ null, size == null ? 0 : ((Number) size).intValue(), sort);+ List<Object> want = (List<Object>) config.get("results");+ assertEquals(want.size(), got.size(), "one prediction per state");+ for (int i = 0; i < want.size(); i++) {+ Map<String, Object> w = (Map<String, Object>) want.get(i);+ // Order matters: grouping is an implementation choice and the results+ // must come back in the caller's order whatever the grouping was.+ assertAnswers((Map<String, Object>) w.get("answers"),+ got.get(i).answers());+ assertUsage((Map<String, Object>) w.get("usage"), got.get(i).usage());+ }+ }));+ }+ return tests;+ }++ @SuppressWarnings("unchecked")+ private static void assertAnswers(Map<String, Object> want, Map<String, Answer> got) {+ assertIterableEquals(want.keySet(), got.keySet(), "question ids and their order");+ for (Map.Entry<String, Object> entry : want.entrySet()) {+ Map<String, Object> w = (Map<String, Object>) entry.getValue();+ Answer g = got.get(entry.getKey());+ String at = entry.getKey();+ assertEquals(w.get("type"), g.type(), at + ".type");+ assertEquals(number(w.get("answer_confidence")), g.answerConfidence(),+ PROBABILITY_TOLERANCE, at + ".answer_confidence");+ assertEquals(number(w.get("confidence")), g.confidence(),+ PROBABILITY_TOLERANCE, at + ".confidence");+ assertEquals(number(((Map<String, Object>) w.get("action")).get("act_probability")),+ g.actProbability(), PROBABILITY_TOLERANCE, at + ".act_probability");+ if (g instanceof Answer.Choice choice) {+ Map<String, Object> probabilities = (Map<String, Object>) w.get("probabilities");+ assertProbabilities(at, probabilities, choice.probabilities());+ if (decisive(probabilities)) {+ assertEquals(w.get("choice"), choice.choice(), at + ".choice");+ }+ } else if (g instanceof Answer.Score score) {+ assertEquals(number(w.get("score")), score.score(), PROBABILITY_TOLERANCE * 4,+ at + ".score");+ assertProbabilities(at, (Map<String, Object>) w.get("probabilities"),+ score.probabilities());+ Map<String, Object> legend = (Map<String, Object>) w.get("legend");+ assertIterableEquals(legend.keySet(), score.legend().keySet(), at + ".legend order");+ for (Map.Entry<String, Object> level : legend.entrySet()) {+ assertEquals(level.getValue(), score.legend().get(level.getKey()));+ }+ } else if (g instanceof Answer.Noul noul) {+ assertEquals(number(w.get("noul")), noul.noul(), PROBABILITY_TOLERANCE, at + ".noul");+ }+ }+ }++ /** Whether the top two probabilities are far enough apart for the argmax to be meaningful. */+ private static boolean decisive(Map<String, Object> probabilities) {+ double best = -1.0;+ double second = -1.0;+ for (Object value : probabilities.values()) {+ double p = number(value);+ if (p > best) {+ second = best;+ best = p;+ } else if (p > second) {+ second = p;+ }+ }+ return best - second > PROBABILITY_TOLERANCE * 5;+ }++ private static void assertProbabilities(String at, Map<String, Object> want,+ Map<String, Double> got) {+ assertIterableEquals(want.keySet(), got.keySet(), at + ".probability key order");+ for (Map.Entry<String, Object> entry : want.entrySet()) {+ assertEquals(number(entry.getValue()), got.get(entry.getKey()),+ PROBABILITY_TOLERANCE, at + ".p[" + entry.getKey() + "]");+ }+ }++ @SuppressWarnings("unchecked")+ private static void assertUsage(Map<String, Object> want, Usage got) {+ // Exact: these are counts, and a count that drifts is a bug, not float noise.+ assertEquals(((Number) want.get("input_tokens")).intValue(), got.inputTokens(),+ "usage.input_tokens");+ assertEquals(((Number) want.get("output_tokens")).intValue(), got.outputTokens());+ assertEquals(((Number) want.get("state_tokens")).intValue(), got.stateTokens(),+ "usage.state_tokens");+ assertEquals(((Number) want.get("state_tokens_dropped")).intValue(),+ got.stateTokensDropped(), "usage.state_tokens_dropped");+ assertEquals(want.get("truncated"), got.truncated(), "usage.truncated");+ assertIterableEquals((List<Object>) want.get("truncated_questions"),+ got.truncatedQuestions(), "usage.truncated_questions");+ Map<String, Object> options = (Map<String, Object>) want.get("options");+ if (options == null) {+ assertTrue(got.collapsedOptions().isEmpty(),+ "no collapse expected, got " + got.collapsedOptions().keySet());+ return;+ }+ assertEquals(options.keySet(), got.collapsedOptions().keySet(), "usage.options");+ for (Map.Entry<String, Object> entry : options.entrySet()) {+ Map<String, Object> w = (Map<String, Object>) entry.getValue();+ Usage.CollapsedOptions g = got.collapsedOptions().get(entry.getKey());+ assertEquals(((Number) w.get("total")).intValue(), g.total());+ assertEquals(((Number) w.get("distinct")).intValue(), g.distinct());+ }+ }++ private static double number(Object value) {+ return ((Number) value).doubleValue();+ }++ @SuppressWarnings("unchecked")+ private static Map<String, Question> questionsOf(Map<String, Object> defs) {+ Map<String, Question> out = new LinkedHashMap<>();+ for (Map.Entry<String, Object> entry : defs.entrySet()) {+ Map<String, Object> q = (Map<String, Object>) entry.getValue();+ String type = (String) q.get("type");+ String instructions = String.valueOf(q.get("instructions"));+ Object criteria = q.get("criteria");+ if ("choice".equals(type)) {+ out.put(entry.getKey(), Question.choice(instructions, (Map<String, Object>) criteria));+ } else if ("score".equals(type)) {+ out.put(entry.getKey(), Question.score(instructions, (List<Object>) criteria));+ } else {+ Map<String, Object> sides = criteria instanceof Map+ ? (Map<String, Object>) criteria : Map.of();+ out.put(entry.getKey(), Question.noul(instructions, sides.get("false"),+ sides.get("true"), null));+ }+ }+ return out;+ }++ private static Map<String, Object> requireGolden() {+ Map<String, Object> golden = Fixtures.load("predict.json");+ Assumptions.assumeFalse(golden.containsKey("skipped"),+ "predict.json was recorded without a graph: set " + Fixtures.GRAPH_ENV+ + " and re-run scripts/gen_fixtures.py");+ return golden;+ }++ /** The shared agent, opened on first use so the assumptions still skip cleanly. */+ private static synchronized Agent agent(Map<String, Object> golden) throws IOException {+ if (shared == null) {+ shared = openAgent(golden);+ }+ return shared;+ }++ private static Agent openAgent(Map<String, Object> golden) throws IOException {+ String checkpoint = (String) golden.getOrDefault("checkpoint", "multilingual");+ Path model = Fixtures.checkpoint(checkpoint);+ Assumptions.assumeTrue(model != null, Fixtures.missingCheckpoint(checkpoint));+ String graph = System.getenv(Fixtures.GRAPH_ENV);+ Assumptions.assumeTrue(graph != null && !graph.isBlank(),+ "set " + Fixtures.GRAPH_ENV + " to the exported laya.onnx this golden was recorded from");+ Path graphPath = Paths.get(graph);+ Path graphDirectory = Files.isDirectory(graphPath) ? graphPath : graphPath.getParent();+ Assumptions.assumeTrue(graphDirectory != null && Files.isDirectory(graphDirectory),+ Fixtures.GRAPH_ENV + " does not name a graph: " + graph);+ return Agent.open(model, graphDirectory);+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/QuestionRenderingTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/QuestionRenderingTest.javanew file mode 100644index 00000000..d160b5d8--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/QuestionRenderingTest.java@@ -0,0 +1,168 @@+package com.convaiinnovations.laya;++import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertThrows;+import static org.junit.jupiter.api.Assertions.assertIterableEquals;++import java.util.ArrayList;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;++/**+ * Option rendering is the text the model reads, so it is a character-for-character contract.+ *+ * <p>Everything downstream is token ids derived from these strings; a rendering difference changes+ * the answer and nothing in the answer looks wrong.+ */+final class QuestionRenderingTest {++ private static Map<String, Object> criteria(Object... pairs) {+ Map<String, Object> out = new LinkedHashMap<>();+ for (int i = 0; i < pairs.length; i += 2) {+ out.put((String) pairs[i], pairs[i + 1]);+ }+ return out;+ }++ @Test+ @DisplayName("a described choice renders 'label: description', an undescribed one its label alone")+ void choiceRendering() {+ assertIterableEquals(List.of("refund: money back", "other"),+ Question.choice("i", criteria("refund", "money back", "other", null)).renderOptions());+ assertIterableEquals(List.of("a"),+ Question.choice("i", criteria("a", "")).renderOptions());+ }++ @Test+ @DisplayName("only null and the empty string mean 'no description': 0 and false are values")+ void falsyCriteriaAreValues() {+ // Python's rule is `v is None or v == ""`, so a zero and a false are legitimate criteria+ // and must render. A port using a truthiness test loses both.+ assertIterableEquals(List.of("zero: 0", "no: false", "bare"),+ Question.choice("i", criteria("zero", 0L, "no", Boolean.FALSE, "bare", null))+ .renderOptions());+ }++ @Test+ @DisplayName("a structured criterion renders as the JSON the model was shown")+ void structuredCriteria() {+ List<String> rendered = Question.choice("i",+ criteria("a", Map.of("d", 1L), "b", List.of(1L, 2L))).renderOptions();+ // Python spells these with `", "` and `": "` separators, which `PythonJson` reproduces.+ assertEquals(2, rendered.size());+ org.junit.jupiter.api.Assertions.assertTrue(rendered.contains("a: {\"d\": 1}"), rendered.toString());+ org.junit.jupiter.api.Assertions.assertTrue(rendered.contains("b: [1, 2]"), rendered.toString());+ }++ @Test+ @DisplayName("choice options follow the criteria map's INSERTION order, not a sorted one")+ void choiceOrderIsInsertionOrder() {+ // Positional: two orders are two different questions, and the answer's probabilities are+ // indexed by position. A HashMap passed in must not decide what the model was asked.+ assertIterableEquals(List.of("zebra: z", "apple: a"),+ Question.choice("i", criteria("zebra", "z", "apple", "a")).renderOptions());+ List<String> copied = new ArrayList<>(+ Question.choice("i", criteria("zebra", "z", "apple", "a")).labels());+ assertIterableEquals(List.of("zebra", "apple"), copied);+ }++ @Test+ @DisplayName("score levels render with their index and a legend keyed by index")+ void scoreRendering() {+ Question q = Question.score("i", List.of("bad", "ok"));+ assertIterableEquals(List.of("level 0: bad", "level 1: ok"), q.renderOptions());+ assertEquals(Map.of("0", "bad", "1", "ok"), q.legend());+ assertIterableEquals(List.of("0", "1"), q.labels());+ }++ @Test+ @DisplayName("a numeric score level comes back as text, so the answer's shape is stable")+ void scoreLegendStringifiesNumbers() {+ // A scale passed as [1, 2, 3] must not make the legend's value types depend on the caller.+ assertEquals(Map.of("0", "1", "1", "2"), Question.score("i", List.of(1L, 2L)).legend());+ }++ @Test+ @DisplayName("noul is always [false, true] with the documented defaults")+ void noulDefaults() {+ assertIterableEquals(+ List.of("false: no, the statement does not hold", "true: yes, the statement holds"),+ Question.noul("i").renderOptions());+ }++ @Test+ @DisplayName("noul labels replace the label but not the default descriptions")+ void noulLabels() {+ Question q = Question.noul("i", null, null, Map.of("false", " nope ", "true", "yep"));+ assertIterableEquals(+ List.of("nope: no, the statement does not hold", "yep: yes, the statement holds"),+ q.renderOptions());+ assertIterableEquals(List.of("nope", "yep"), q.labels());+ }++ @Test+ @DisplayName("noul labels are validated: both present, non-blank and distinct")+ void noulLabelsValidated() {+ assertThrows(IllegalArgumentException.class,+ () -> Question.noul("i", null, null, Map.of("false", "a")));+ assertThrows(IllegalArgumentException.class,+ () -> Question.noul("i", null, null, Map.of("false", " ", "true", "b")));+ assertThrows(IllegalArgumentException.class,+ () -> Question.noul("i", null, null, Map.of("false", "same", "true", "same")));+ }++ @Test+ @DisplayName("a legend is a score question's alone")+ void legendIsScoreOnly() {+ assertThrows(IllegalStateException.class, () -> Question.noul("i").legend());+ assertThrows(IllegalStateException.class,+ () -> Question.choice("i", criteria("a", "b")).legend());+ }++ @Test+ @DisplayName("an empty question is refused at construction, not at inference")+ void emptyQuestionsRefused() {+ assertThrows(IllegalArgumentException.class, () -> Question.choice("i", Map.of()));+ assertThrows(IllegalArgumentException.class, () -> Question.score("i", List.of()));+ assertThrows(IllegalArgumentException.class, () -> Question.choice(null, criteria("a", "b")));+ }++ @Test+ @DisplayName("blank instructions are refused, not just null ones")+ void blankInstructionsRefused() {+ // An empty instruction produces the text "choice question: " and asks the model nothing,+ // which it answers anyway with a confident-looking distribution. Python refuses it.+ for (String blank : new String[] {"", " ", "\t\n"}) {+ assertThrows(IllegalArgumentException.class,+ () -> Question.choice(blank, criteria("a", "b")), "choice with " + blank.length()+ + " blank chars");+ assertThrows(IllegalArgumentException.class, () -> Question.noul(blank));+ assertThrows(IllegalArgumentException.class, () -> Question.score(blank, List.of("x")));+ }+ }++ @Test+ @DisplayName("a null score level is refused rather than rendered as the text 'null'")+ void nullScoreLevelRefused() {+ List<Object> levels = new ArrayList<>();+ levels.add("fine");+ levels.add(null);+ IllegalArgumentException refused = assertThrows(IllegalArgumentException.class,+ () -> Question.score("i", levels));+ // The index is named, because that is what the caller has to go and fix.+ org.junit.jupiter.api.Assertions.assertTrue(refused.getMessage().contains("level 1"),+ refused.getMessage());+ }++ @Test+ @DisplayName("the question type's integer code is a model input and must not drift")+ void typeCodes() {+ assertEquals(0, Question.Type.CHOICE.code());+ assertEquals(1, Question.Type.SCORE.code());+ assertEquals(2, Question.Type.NOUL.code());+ assertEquals("choice", Question.Type.CHOICE.wireName());+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/TinyCheckpoint.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/TinyCheckpoint.javanew file mode 100644index 00000000..855d6712--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/TinyCheckpoint.java@@ -0,0 +1,214 @@+package com.convaiinnovations.laya;++import com.convaiinnovations.laya.config.AgentConfig;+import com.convaiinnovations.laya.infer.InferenceSession;+import com.convaiinnovations.laya.sequence.Collator;+import com.convaiinnovations.laya.tokenizer.Tokenizer;+import java.io.IOException;+import java.nio.charset.StandardCharsets;+import java.nio.file.Files;+import java.nio.file.Path;+import java.util.ArrayList;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;++/**+ * A synthetic checkpoint, so the parts that have nothing to do with a model can be tested without+ * one.+ *+ * <p>Batching, row offsets, usage accounting and result ordering are the most likely things to be+ * wrong and the least related to inference. Requiring a 1.2 GB graph to exercise them would keep+ * them out of any CI that does not download a checkpoint, which is exactly where a regression+ * would then live.+ *+ * <p>The tokenizer is real, not a mock: a byte-level model whose vocabulary is the 243 single-byte+ * symbols text can reach, so every input encodes and the ids are predictable (one id per UTF-8+ * byte, with no merges).+ */+public final class TinyCheckpoint {++ /** Ids assigned to the four special tokens, above the byte alphabet. */+ public static final int CLS = 243;+ public static final int SEP = 244;+ public static final int MASK = 245;+ public static final int PAD = 246;++ private TinyCheckpoint() {+ }++ /** Writes {@code tokenizer/} and {@code rl_agent_config.json} under {@code root}. */+ public static void write(Path root, int maxLen, int headMaxLen) throws IOException {+ Path tokenizerDir = root.resolve("tokenizer");+ Files.createDirectories(tokenizerDir);+ Files.writeString(tokenizerDir.resolve("tokenizer.json"), tokenizerJson(),+ StandardCharsets.UTF_8);+ Files.writeString(tokenizerDir.resolve("tokenizer_config.json"), """+ {"cls_token": "[CLS]", "sep_token": "[SEP]", "mask_token": "[MASK]",+ "pad_token": "[PAD]"}+ """, StandardCharsets.UTF_8);+ Files.writeString(root.resolve("rl_agent_config.json"),+ "{\"max_len\": " + maxLen + ", \"head_max_len\": " + headMaxLen+ + ", \"temperature\": [1.0, 1.0, 1.0], \"temperature_by_options\": {}}",+ StandardCharsets.UTF_8);+ }++ /** Opens an agent over a synthetic checkpoint and the given session. */+ public static Agent agent(Path root, InferenceSession session) throws IOException {+ return Agent.using(Tokenizer.fromModelDirectory(root),+ AgentConfig.fromModelDirectory(root), session);+ }++ /**+ * A byte-level BPE tokenizer with no merges, so one UTF-8 byte is one token.+ *+ * <p>No merges is what makes the expected ids computable by hand in a test: a sequence's length+ * is the byte length of its text plus its special tokens.+ */+ private static String tokenizerJson() {+ char[] byteToChar = byteLevelAlphabet();+ StringBuilder vocab = new StringBuilder();+ int next = 0;+ for (int b = 0; b < 256; b++) {+ if (b == 0xC0 || b == 0xC1 || b >= 0xF5) {+ continue; // unreachable from valid UTF-8; see PreTokenizer.ByteLevel+ }+ if (next > 0) {+ vocab.append(", ");+ }+ vocab.append('"').append(escape(byteToChar[b])).append("\": ").append(next++);+ }+ // Specials live in added_tokens, as they do in the english checkpoint, where 88 of them are+ // absent from model.vocab entirely.+ String added = """+ [{"id": 243, "content": "[CLS]", "special": true, "lstrip": false,+ "rstrip": false, "single_word": false, "normalized": false},+ {"id": 244, "content": "[SEP]", "special": true, "lstrip": false,+ "rstrip": false, "single_word": false, "normalized": false},+ {"id": 245, "content": "[MASK]", "special": true, "lstrip": false,+ "rstrip": false, "single_word": false, "normalized": false},+ {"id": 246, "content": "[PAD]", "special": true, "lstrip": false,+ "rstrip": false, "single_word": false, "normalized": false}]""";+ return "{\"version\": \"1.0\", \"added_tokens\": " + added+ + ", \"normalizer\": null"+ + ", \"pre_tokenizer\": {\"type\": \"ByteLevel\", \"add_prefix_space\": false,"+ + " \"trim_offsets\": true, \"use_regex\": false}"+ + ", \"model\": {\"type\": \"BPE\", \"vocab\": {" + vocab + "}, \"merges\": [],"+ + " \"unk_token\": null, \"fuse_unk\": false, \"byte_fallback\": false,"+ + " \"ignore_merges\": false}}";+ }++ private static char[] byteLevelAlphabet() {+ boolean[] printable = new boolean[256];+ for (int b = '!'; b <= '~'; b++) {+ printable[b] = true;+ }+ for (int b = 0xA1; b <= 0xAC; b++) {+ printable[b] = true;+ }+ for (int b = 0xAE; b <= 0xFF; b++) {+ printable[b] = true;+ }+ char[] table = new char[256];+ int lifted = 0;+ for (int b = 0; b < 256; b++) {+ table[b] = printable[b] ? (char) b : (char) (256 + lifted++);+ }+ return table;+ }++ private static String escape(char c) {+ if (c == '"') {+ return "\\\"";+ }+ if (c == '\\') {+ return "\\\\";+ }+ return c < 0x20 ? String.format("\\u%04x", (int) c) : String.valueOf(c);+ }++ /**+ * A session whose output is derived from each row's CONTENT, and which records every batch.+ *+ * <p>Content, not the row's index in the batch. That distinction is the whole point: a real+ * model's output for a row depends on the row, not on which other rows it was padded next to,+ * so a stub keyed on the index would make "the answers are the same at every batch size"+ * trivially false -- it was, and the test caught it. Keyed on content, the same assertion+ * actually tests the batching.+ *+ * <p>The value still varies per row (different questions produce different ids), and rises+ * with the option slot, so an off-by-one in the row offsets changes an answer and a test can+ * see it.+ */+ public static class RecordingSession implements InferenceSession {+ // Not final: a test subclasses it to perturb state mid-call, which is how the+ // questions-map snapshot is proved rather than asserted.++ public final List<Collator.Batch> batches = new ArrayList<>();+ public boolean closed;++ @Override+ public Output run(Collator.Batch batch) {+ batches.add(batch);+ float[][] logits = new float[batch.rows()][Math.max(1, batch.markers())];+ float[][] act = new float[batch.rows()][2];+ for (int r = 0; r < batch.rows(); r++) {+ int markers = 0;+ for (boolean live : batch.markerMask()[r]) {+ if (live) {+ markers++;+ }+ }+ float base = fingerprint(batch, r);+ for (int m = 0; m < logits[r].length; m++) {+ // Monotone in the slot so the argmax is the last live option, and offset by the+ // row's own fingerprint so two questions never share a row's output.+ logits[r][m] = m < markers ? base + m : 99.0f;+ }+ act[r][0] = base;+ act[r][1] = 0.0f;+ }+ return new Output(logits, act);+ }++ /**+ * A small, stable number derived from the row's live tokens and markers.+ *+ * <p>Padding is excluded deliberately: it is the one part of a row that DOES change with+ * batch composition, and including it would reintroduce exactly the dependence this exists+ * to avoid.+ */+ private static float fingerprint(Collator.Batch batch, int row) {+ long hash = 0x811C9DC5L;+ for (int i = 0; i < batch.length(); i++) {+ if (batch.attentionMask()[row][i] == 0L) {+ continue;+ }+ hash = (hash ^ batch.inputIds()[row][i]) * 0x01000193L & 0xFFFFFFFFL;+ }+ for (int i = 0; i < batch.markers(); i++) {+ if (batch.markerMask()[row][i]) {+ hash = (hash ^ (batch.markerPos()[row][i] + 1)) * 0x01000193L & 0xFFFFFFFFL;+ }+ }+ hash = (hash ^ batch.qtype()[row]) * 0x01000193L & 0xFFFFFFFFL;+ // A narrow range keeps the softmax away from saturation, so probabilities stay+ // informative rather than collapsing to 1.0 and 0.0.+ return (hash % 1000) / 1000.0f;+ }++ @Override+ public void close() {+ closed = true;+ }+ }++ /** A map literal that keeps insertion order, which a choice question requires. */+ public static Map<String, Object> ordered(Object... pairs) {+ Map<String, Object> out = new LinkedHashMap<>();+ for (int i = 0; i < pairs.length; i += 2) {+ out.put((String) pairs[i], pairs[i + 1]);+ }+ return out;+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/config/AgentConfigTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/config/AgentConfigTest.javanew file mode 100644index 00000000..9324deb3--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/config/AgentConfigTest.java@@ -0,0 +1,126 @@+package com.convaiinnovations.laya.config;++import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertFalse;+import static org.junit.jupiter.api.Assertions.assertThrows;+import static org.junit.jupiter.api.Assertions.assertTrue;++import com.convaiinnovations.laya.Question;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;++/** Budgets, temperature clamping, bucket selection and the language override. */+final class AgentConfigTest {++ @Test+ @DisplayName("budgets come from the checkpoint, never from a library default")+ void budgetsAreRead() {+ AgentConfig config = AgentConfig.fromJson(+ "{\"max_len\": 1024, \"head_max_len\": 256, \"temperature\": [1, 1, 1]}");+ assertEquals(1024, config.maxLen());+ assertEquals(256, config.headMaxLen());+ }++ @Test+ @DisplayName("a sharpening temperature is clamped: the shipped choice:11+ is 0.1006")+ void sharpeningIsClamped() {+ // Applied raw, 0.1006 multiplies logits ~10x and publishes a 0.24 top probability as 0.99.+ AgentConfig config = AgentConfig.fromJson(+ "{\"temperature\": [1.0, 1.0, 1.0],"+ + " \"temperature_by_options\": {\"choice:11+\": 0.100583}}");+ assertEquals(AgentConfig.TEMP_MIN,+ config.temperatureFor(Question.Type.CHOICE, 20, null), 0.0);+ }++ @Test+ @DisplayName("a non-number, a boolean, NaN and an infinity all fall back to 1.0")+ void nonNumbersFallBack() {+ // A bool used to float to 1.0/0.0 and read as a fitted or sharpening temperature.+ assertEquals(1.0, AgentConfig.clampTemperature(Boolean.TRUE), 0.0);+ assertEquals(1.0, AgentConfig.clampTemperature(Boolean.FALSE), 0.0);+ assertEquals(1.0, AgentConfig.clampTemperature("2.0"), 0.0);+ assertEquals(1.0, AgentConfig.clampTemperature(null), 0.0);+ assertEquals(1.0, AgentConfig.clampTemperature(Double.NaN), 0.0);+ assertEquals(1.0, AgentConfig.clampTemperature(Double.POSITIVE_INFINITY), 0.0);+ assertEquals(AgentConfig.TEMP_MAX, AgentConfig.clampTemperature(99.0), 0.0);+ }++ @Test+ @DisplayName("bucket boundaries are at 2, 5 and 10 options")+ void bucketBoundaries() {+ assertEquals("choice:2", AgentConfig.temperatureBucket(Question.Type.CHOICE, 1));+ assertEquals("choice:2", AgentConfig.temperatureBucket(Question.Type.CHOICE, 2));+ assertEquals("choice:3-5", AgentConfig.temperatureBucket(Question.Type.CHOICE, 3));+ assertEquals("choice:3-5", AgentConfig.temperatureBucket(Question.Type.CHOICE, 5));+ assertEquals("choice:6-10", AgentConfig.temperatureBucket(Question.Type.CHOICE, 6));+ assertEquals("choice:6-10", AgentConfig.temperatureBucket(Question.Type.CHOICE, 10));+ assertEquals("choice:11+", AgentConfig.temperatureBucket(Question.Type.CHOICE, 11));+ assertEquals("score:3-5", AgentConfig.temperatureBucket(Question.Type.SCORE, 4));+ assertEquals("noul:2", AgentConfig.temperatureBucket(Question.Type.NOUL, 2));+ }++ @Test+ @DisplayName("a bucket beats the per-type default, and a language beats both")+ void overridePrecedence() {+ AgentConfig config = AgentConfig.fromJson(+ "{\"temperature\": [1.5, 2.0, 2.5],"+ + " \"temperature_by_options\": {\"choice:2\": 1.75},"+ + " \"lang_temperatures\": {\"zh\": {\"temperature\": [3.0, 3.0, 3.0],"+ + " \"temperature_by_options\": {\"choice:2\": 4.0}}}}");+ assertEquals(1.75, config.temperatureFor(Question.Type.CHOICE, 2, null), 0.0);+ assertEquals(1.5, config.temperatureFor(Question.Type.CHOICE, 7, null), 0.0);+ assertEquals(4.0, config.temperatureFor(Question.Type.CHOICE, 2, "zh"), 0.0);+ assertEquals(3.0, config.temperatureFor(Question.Type.CHOICE, 7, "zh"), 0.0);+ }++ @Test+ @DisplayName("a language tag matches on its prefix, case-insensitively")+ void languagePrefixMatching() {+ AgentConfig config = AgentConfig.fromJson(+ "{\"temperature\": [1.0, 1.0, 1.0],"+ + " \"lang_temperatures\": {\"zh-Hans\": {\"temperature\": [3.0, 3.0, 3.0]}}}");+ assertTrue(config.hasLanguageOverride("zh"));+ assertTrue(config.hasLanguageOverride("ZH-Hant"));+ assertTrue(config.hasLanguageOverride("zh-Hans"));+ assertFalse(config.hasLanguageOverride("zho"));+ assertFalse(config.hasLanguageOverride(""));+ assertFalse(config.hasLanguageOverride(null));+ assertEquals(3.0, config.temperatureFor(Question.Type.CHOICE, 2, "ZH"), 0.0);+ }++ @Test+ @DisplayName("a null language entry inherits the checkpoint's own temperatures")+ void nullEntryInherits() {+ AgentConfig config = AgentConfig.fromJson(+ "{\"temperature\": [2.5, 1.0, 1.0], \"lang_temperatures\": {\"de\": null}}");+ assertTrue(config.hasLanguageOverride("de"));+ assertEquals(2.5, config.temperatureFor(Question.Type.CHOICE, 2, "de"), 0.0);+ }++ @Test+ @DisplayName("a malformed language override is refused at load, not at the first request")+ void malformedOverrideRefused() {+ assertThrows(IllegalArgumentException.class, () -> AgentConfig.fromJson(+ "{\"temperature\": [1,1,1], \"lang_temperatures\": {\"de\": {\"temperature\": 2}}}"));+ assertThrows(IllegalArgumentException.class, () -> AgentConfig.fromJson(+ "{\"temperature\": [1,1,1], \"lang_temperatures\": {\"de\": \"nope\"}}"));+ assertThrows(IllegalArgumentException.class, () -> AgentConfig.fromJson(+ "{\"temperature\": [1,1,1],"+ + " \"lang_temperatures\": {\"de\": {\"temperature_by_options\": 5}}}"));+ }++ @Test+ @DisplayName("the temperature array must have one entry per question type")+ void temperatureArityChecked() {+ assertThrows(RuntimeException.class,+ () -> AgentConfig.fromJson("{\"temperature\": [1.0, 2.0]}"));+ }++ @Test+ @DisplayName("the temperature array is copied, so a caller cannot mutate the config")+ void temperatureIsCopied() {+ AgentConfig config = AgentConfig.fromJson("{\"temperature\": [1.5, 1.5, 1.5]}");+ config.temperature()[0] = 99.0;+ assertEquals(1.5, config.temperatureFor(Question.Type.CHOICE, 7, null), 0.0);+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/decode/DecoderParityTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/decode/DecoderParityTest.javanew file mode 100644index 00000000..307cffa0--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/decode/DecoderParityTest.java@@ -0,0 +1,145 @@+package com.convaiinnovations.laya.decode;++import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertIterableEquals;+import static org.junit.jupiter.api.Assertions.assertTrue;++import com.convaiinnovations.laya.Answer;+import com.convaiinnovations.laya.Fixtures;+import com.convaiinnovations.laya.Question;+import com.convaiinnovations.laya.config.AgentConfig;+import com.convaiinnovations.laya.json.PythonJson;+import java.util.ArrayList;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.DynamicTest;+import org.junit.jupiter.api.TestFactory;++/**+ * Answer decoding against expectations recorded from laya's own {@code Agent._decode_answers}.+ *+ * <p>Needs no checkpoint and no graph -- the logit rows are synthesised -- so this is the parity+ * gate CI can run on every push. The rows are chosen to hit branches rather than to look+ * realistic: every temperature bucket, a tie at the top, an exactly uniform softmax, magnitudes of+ * +/-700 that overflow a naive {@code exp}, a logit block wider than the option count, permuted+ * option orders, and the per-language override.+ */+final class DecoderParityTest {++ @TestFactory+ @DisplayName("decoded answers match Python, field by field")+ @SuppressWarnings("unchecked")+ List<DynamicTest> matchesPython() {+ Map<String, Object> fixture = Fixtures.load("decode.json");+ List<DynamicTest> tests = new ArrayList<>();+ for (String model : List.of("english", "multilingual")) {+ Map<String, Object> side = (Map<String, Object>) fixture.get(model);+ if (side == null || side.containsKey("skipped")) {+ continue;+ }+ AgentConfig config = configOf((Map<String, Object>) side.get("config"));+ Map<String, Object> cases = (Map<String, Object>) side.get("cases");+ for (Map.Entry<String, Object> entry : cases.entrySet()) {+ Map<String, Object> c = (Map<String, Object>) entry.getValue();+ tests.add(DynamicTest.dynamicTest(model + "/" + entry.getKey(),+ () -> check(c, config)));+ }+ }+ assertTrue(tests.size() >= 20, "expected both checkpoints' decode cases, got " + tests.size());+ return tests;+ }++ @SuppressWarnings("unchecked")+ private static void check(Map<String, Object> c, AgentConfig config) {+ Question question = questionOf((Map<String, Object>) c.get("question"));+ List<Object> logits = (List<Object>) c.get("logits");+ int optionCount = logits.size();+ int width = ((Number) c.get("logits_block_width")).intValue();+ // Padded out past the option count on purpose: the head's real output is padded to the+ // widest question in the batch with large FINITE numbers, so a port that forgets to slice+ // hands almost all the probability mass to padding.+ float[] row = new float[width];+ for (int i = 0; i < width; i++) {+ row[i] = i < optionCount ? ((Number) logits.get(i)).floatValue() : 99.0f;+ }+ List<Object> act = (List<Object>) c.get("act");+ float[] actionProbabilities = {((Number) act.get(0)).floatValue(),+ ((Number) act.get(1)).floatValue()};+ int[] order = c.get("option_order") == null ? null+ : Fixtures.ints(c.get("option_order"));++ Answer got = Decoder.decode(question, row, optionCount, actionProbabilities, order,+ (String) c.get("lang"), config);+ Map<String, Object> want = (Map<String, Object>) c.get("answer");++ assertEquals(want.get("type"), got.type());+ assertEquals(number(want.get("answer_confidence")), got.answerConfidence(), 0.0,+ "answer_confidence");+ assertEquals(number(want.get("confidence")), got.confidence(), 0.0, "confidence");+ assertEquals(number(((Map<String, Object>) want.get("action")).get("act_probability")),+ got.actProbability(), 0.0, "act_probability");+ if (got instanceof Answer.Choice choice) {+ assertEquals(want.get("choice"), choice.choice());+ assertProbabilities((Map<String, Object>) want.get("probabilities"), choice.probabilities());+ } else if (got instanceof Answer.Score score) {+ assertEquals(number(want.get("score")), score.score(), 0.0, "score");+ assertProbabilities((Map<String, Object>) want.get("probabilities"), score.probabilities());+ Map<String, Object> legend = (Map<String, Object>) want.get("legend");+ assertIterableEquals(legend.keySet(), score.legend().keySet(), "legend key order");+ for (Map.Entry<String, Object> level : legend.entrySet()) {+ assertEquals(level.getValue(), score.legend().get(level.getKey()));+ }+ } else if (got instanceof Answer.Noul noul) {+ assertEquals(number(want.get("noul")), noul.noul(), 0.0, "noul");+ }+ }++ private static void assertProbabilities(Map<String, Object> want, Map<String, Double> got) {+ // Key ORDER, not just the mapping: a choice's probabilities are positional, and+ // `Map.copyOf` would have passed a set comparison while losing the order.+ assertIterableEquals(want.keySet(), got.keySet(), "probability key order");+ for (Map.Entry<String, Object> entry : want.entrySet()) {+ assertEquals(number(entry.getValue()), got.get(entry.getKey()), 0.0,+ "p[" + entry.getKey() + "]");+ }+ }++ private static double number(Object value) {+ return ((Number) value).doubleValue();+ }++ @SuppressWarnings("unchecked")+ private static AgentConfig configOf(Map<String, Object> node) {+ Map<String, Object> document = new LinkedHashMap<>();+ document.put("temperature", node.get("temperature"));+ document.put("temperature_by_options", node.get("temperature_by_options"));+ document.put("lang_temperatures", node.get("lang_temperatures_raw"));+ return AgentConfig.fromJson(PythonJson.dumps(document));+ }++ @SuppressWarnings("unchecked")+ private static Question questionOf(Map<String, Object> q) {+ String type = (String) q.get("t");+ String instructions = (String) q.get("ins");+ Object criteria = q.get("crit");+ if ("choice".equals(type)) {+ return Question.choice(instructions, (Map<String, Object>) criteria);+ }+ if ("score".equals(type)) {+ return Question.score(instructions, (List<Object>) criteria);+ }+ Map<String, Object> sides = criteria instanceof Map+ ? (Map<String, Object>) criteria : Map.of();+ Map<String, Object> labels = (Map<String, Object>) q.get("labels");+ Map<String, String> resolved = null;+ if (labels != null) {+ resolved = new LinkedHashMap<>();+ for (Map.Entry<String, Object> label : labels.entrySet()) {+ resolved.put(label.getKey(), (String) label.getValue());+ }+ }+ return Question.noul(instructions, sides.get("false"), sides.get("true"), resolved);+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/decode/RoundingTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/decode/RoundingTest.javanew file mode 100644index 00000000..7928196f--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/decode/RoundingTest.java@@ -0,0 +1,72 @@+package com.convaiinnovations.laya.decode;++import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertTrue;++import com.convaiinnovations.laya.Fixtures;+import java.util.List;+import java.util.Map;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;++/**+ * Every number in an answer goes through {@code round(value, 4)}, and Python rounds half to EVEN+ * on the exact binary value.+ *+ * <p>The fixture separates real softmax output from exactly-representable halfway values, because+ * the two groups say different things: on softmax output a half-up implementation also agrees, so+ * only the halfway group can tell the two rules apart. A failure names which group broke.+ */+final class RoundingTest {++ @Test+ @DisplayName("half-even matches CPython on every group, including engineered halfway values")+ @SuppressWarnings("unchecked")+ void matchesCPython() {+ Map<String, Object> groups = (Map<String, Object>) Fixtures.load("python_json.json").get("round4");+ assertTrue(groups.containsKey("halfway"), "the halfway group is what discriminates the rules");+ for (Map.Entry<String, Object> group : groups.entrySet()) {+ for (Object entry : (List<Object>) group.getValue()) {+ Map<String, Object> row = (Map<String, Object>) entry;+ double value = Double.longBitsToDouble(((Number) row.get("bits")).longValue());+ assertEquals(((Number) row.get("r4")).doubleValue(), Rounding.round4(value),+ "round4 of bits " + row.get("bits") + " in group " + group.getKey());+ }+ }+ }++ @Test+ @DisplayName("the laya-ts spelling agrees on softmax output and disagrees on halfway values")+ @SuppressWarnings("unchecked")+ void halfUpAgreesOnlyWhereItCan() {+ Map<String, Object> groups = (Map<String, Object>) Fixtures.load("python_json.json").get("round4");+ int softmaxMismatches = countMismatches((List<Object>) groups.get("softmax"));+ int halfwayMismatches = countMismatches((List<Object>) groups.get("halfway"));+ // This is the measurement that justified departing from `laya-ts` here, kept as a test so+ // the claim cannot rot into a comment that is no longer true.+ assertEquals(0, softmaxMismatches,+ "half-up should match CPython on real softmax output");+ assertTrue(halfwayMismatches > 0,+ "the halfway group must actually discriminate the two rounding rules");+ }++ @SuppressWarnings("unchecked")+ private static int countMismatches(List<Object> rows) {+ int mismatches = 0;+ for (Object entry : rows) {+ Map<String, Object> row = (Map<String, Object>) entry;+ double value = Double.longBitsToDouble(((Number) row.get("bits")).longValue());+ if (Rounding.round4HalfUp(value) != ((Number) row.get("r4")).doubleValue()) {+ mismatches++;+ }+ }+ return mismatches;+ }++ @Test+ @DisplayName("a non-finite value passes through rather than raising")+ void nonFinite() {+ assertTrue(Double.isNaN(Rounding.round4(Double.NaN)));+ assertEquals(Double.POSITIVE_INFINITY, Rounding.round4(Double.POSITIVE_INFINITY));+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/json/PythonJsonTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/json/PythonJsonTest.javanew file mode 100644index 00000000..f49f547f--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/json/PythonJsonTest.java@@ -0,0 +1,133 @@+package com.convaiinnovations.laya.json;++import static org.junit.jupiter.api.Assertions.assertEquals;++import com.convaiinnovations.laya.Fixtures;+import java.util.List;+import java.util.Map;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;++/**+ * {@link PythonJson} must spell a value exactly as CPython's+ * {@code json.dumps(..., ensure_ascii=False)} spells it.+ *+ * <p>Not a nicety: {@code serialize_state} and {@code render_criterion} feed their output straight+ * to the tokenizer, so every character becomes token ids. A float spelled {@code 1.0E16} where+ * Python writes {@code 1e+16} is a different sequence and a different answer.+ */+final class PythonJsonTest {++ @Test+ @DisplayName("every double is spelled as CPython spells it")+ @SuppressWarnings("unchecked")+ void doublesMatchCPython() {+ List<Object> cases = (List<Object>) Fixtures.load("python_json.json").get("doubles");+ int checked = 0;+ java.util.Set<Double> covered = new java.util.HashSet<>();+ for (Object entry : cases) {+ Map<String, Object> row = (Map<String, Object>) entry;+ double value = Double.longBitsToDouble(((Number) row.get("bits")).longValue());+ covered.add(value);+ // The operand is carried as a bit pattern, not as decimal text: the thing under test is+ // the SPELLING of a double, and a decimal literal would lose it on the way in.+ assertEquals((String) row.get("repr"), PythonJson.repr(value),+ "repr of the double with bits " + row.get("bits"));+ checked++;+ }+ org.junit.jupiter.api.Assertions.assertTrue(checked > 400,+ "the doubles fixture should be substantial, found " + checked);+ // A size floor alone would survive a fixture that dropped the cases that discriminate, so+ // name the ones that do: each of these is spelled differently by Java than by CPython.+ for (double discriminating : new double[] {1e16, 1e-5, 0.0001, 1e23, -0.0, 5e-324, 2.0}) {+ org.junit.jupiter.api.Assertions.assertTrue(covered.contains(discriminating)+ || (discriminating == 0.0 && covered.contains(-0.0)),+ "the fixture must still cover " + discriminating);+ }+ }++ @Test+ @DisplayName("structured values match, including separators, escaping and key order")+ @SuppressWarnings("unchecked")+ void structuredMatchesCPython() {+ List<Object> cases = (List<Object>) Fixtures.load("python_json.json").get("structured");+ for (Object entry : cases) {+ Map<String, Object> row = (Map<String, Object>) entry;+ assertEquals((String) row.get("dumps"), PythonJson.dumps(row.get("value")));+ }+ }++ @Test+ @DisplayName("a non-finite double is written as CPython writes it, not as invalid JSON we invent")+ void nonFinite() {+ assertEquals("NaN", PythonJson.repr(Double.NaN));+ assertEquals("Infinity", PythonJson.repr(Double.POSITIVE_INFINITY));+ assertEquals("-Infinity", PythonJson.repr(Double.NEGATIVE_INFINITY));+ }++ @Test+ @DisplayName("negative zero keeps its sign, which no arithmetic test would catch")+ void negativeZero() {+ assertEquals("-0.0", PythonJson.repr(-0.0));+ assertEquals("0.0", PythonJson.repr(0.0));+ }++ @Test+ @DisplayName("an unsupported type is refused rather than stringified into the model's input")+ void unsupportedTypeIsRefused() {+ org.junit.jupiter.api.Assertions.assertThrows(Json.JsonException.class,+ () -> PythonJson.dumps(new Object()));+ }++ @Test+ @DisplayName("a non-string key is coerced the way CPython coerces it")+ void nonStringKeysAreCoerced() {+ // CPython writes `{1: "x"}` as `{"1": "x"}` rather than refusing it. This used to throw,+ // on the stated grounds that laya never produces such a key -- true of laya, and not of+ // the caller-supplied Object that reaches here as a state.+ assertEquals("{\"1\": \"x\"}", PythonJson.dumps(new java.util.LinkedHashMap<>(+ Map.of(1L, "x"))));+ assertEquals("{\"true\": 1}", PythonJson.dumps(new java.util.LinkedHashMap<>(+ Map.of(Boolean.TRUE, 1L))));+ java.util.Map<Object, Object> withNull = new java.util.LinkedHashMap<>();+ withNull.put(null, "x");+ assertEquals("{\"null\": \"x\"}", PythonJson.dumps(withNull));+ assertEquals("{\"2.5\": 1}", PythonJson.dumps(new java.util.LinkedHashMap<>(+ Map.of(2.5, 1L))));+ }++ @Test+ @DisplayName("a key type CPython itself refuses is still refused")+ void unsupportedKeyTypeIsRefused() {+ org.junit.jupiter.api.Assertions.assertThrows(Json.JsonException.class,+ () -> PythonJson.dumps(Map.of(List.of(1L), "x")));+ }++ @Test+ @DisplayName("a cyclic value is refused, not recursed into")+ void cyclicValueIsRefused() {+ // A StackOverflowError is an Error, so a server's `catch (Exception)` does not contain it,+ // and the state is caller-supplied. CPython raises ValueError("Circular reference+ // detected"); this raises with the same wording.+ List<Object> list = new java.util.ArrayList<>();+ list.add("a");+ list.add(list);+ Json.JsonException cyclic = org.junit.jupiter.api.Assertions.assertThrows(+ Json.JsonException.class, () -> PythonJson.dumps(list));+ assertEquals("Circular reference detected", cyclic.getMessage());++ java.util.Map<String, Object> map = new java.util.LinkedHashMap<>();+ map.put("self", map);+ org.junit.jupiter.api.Assertions.assertThrows(Json.JsonException.class,+ () -> PythonJson.dumps(map));+ }++ @Test+ @DisplayName("the same container appearing twice is NOT a cycle")+ void repeatedContainerIsNotACycle() {+ // Only a container currently being written is a cycle. A shared sub-object is legitimate+ // and CPython writes it twice, so tracking by identity alone would reject valid input.+ List<Object> shared = List.of(1L, 2L);+ assertEquals("[[1, 2], [1, 2]]", PythonJson.dumps(List.of(shared, shared)));+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/sequence/CollatorTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/sequence/CollatorTest.javanew file mode 100644index 00000000..e48f510f--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/sequence/CollatorTest.java@@ -0,0 +1,50 @@+package com.convaiinnovations.laya.sequence;++import static org.junit.jupiter.api.Assertions.assertArrayEquals;+import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertThrows;++import java.util.List;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;++/** Padding a ragged batch into the rectangular tensors the graph takes. */+final class CollatorTest {++ @Test+ @DisplayName("rows pad to the longest sequence and markers to the most options")+ void padsToTheWidest() {+ Collator.Batch batch = Collator.collate(List.of(+ new Collator.Item(new int[] {1, 2, 3}, new int[] {1}, 0),+ new Collator.Item(new int[] {4}, new int[] {0, 1, 2}, 2)), 99);+ assertEquals(2, batch.rows());+ assertEquals(3, batch.length());+ assertEquals(3, batch.markers());+ assertArrayEquals(new long[] {1, 2, 3}, batch.inputIds()[0]);+ // The pad id fills the tail, and the attention mask is what marks it as absent.+ assertArrayEquals(new long[] {4, 99, 99}, batch.inputIds()[1]);+ assertArrayEquals(new long[] {1, 1, 1}, batch.attentionMask()[0]);+ assertArrayEquals(new long[] {1, 0, 0}, batch.attentionMask()[1]);+ assertArrayEquals(new long[] {1, 0, 0}, batch.markerPos()[0]);+ assertArrayEquals(new boolean[] {true, false, false}, batch.markerMask()[0]);+ assertArrayEquals(new boolean[] {true, true, true}, batch.markerMask()[1]);+ assertArrayEquals(new long[] {0, 2}, batch.qtype());+ }++ @Test+ @DisplayName("an empty batch is refused rather than sent to the graph")+ void emptyRefused() {+ assertThrows(IllegalArgumentException.class, () -> Collator.collate(List.of(), 0));+ }++ @Test+ @DisplayName("a marker position of zero is still a live marker, not padding")+ void zeroIsALiveMarker() {+ // `markerPos` is zero-filled, so only `markerMask` can distinguish "position 0" from+ // "no marker". A port that inferred liveness from the position would mask out option 0.+ Collator.Batch batch = Collator.collate(List.of(+ new Collator.Item(new int[] {7}, new int[] {0}, 1)), 0);+ assertArrayEquals(new long[] {0}, batch.markerPos()[0]);+ assertArrayEquals(new boolean[] {true}, batch.markerMask()[0]);+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/sequence/SequenceParityTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/sequence/SequenceParityTest.javanew file mode 100644index 00000000..300594ce--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/sequence/SequenceParityTest.java@@ -0,0 +1,115 @@+package com.convaiinnovations.laya.sequence;++import static org.junit.jupiter.api.Assertions.assertArrayEquals;+import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertTrue;++import com.convaiinnovations.laya.Fixtures;+import com.convaiinnovations.laya.Question;+import com.convaiinnovations.laya.tokenizer.Tokenizer;+import java.io.IOException;+import java.nio.file.Path;+import java.util.ArrayList;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;+import org.junit.jupiter.api.Assumptions;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.DynamicTest;+import org.junit.jupiter.api.TestFactory;++/**+ * Built sequences against {@code laya.common.build_sequence}: ids, markers, option stats and the+ * truncation report.+ *+ * <p>Markers are asserted, not inferred: a marker off by one still produces a plausible answer.+ * The stats and the truncation report are asserted for the same reason -- {@code options_distinct}+ * and {@code state_tokens_dropped} are invisible from the ids alone, and they are what tells a+ * caller that evidence was silently discarded.+ */+final class SequenceParityTest {++ @TestFactory+ @DisplayName("every budget and rendering branch matches Python, on both checkpoints")+ @SuppressWarnings("unchecked")+ List<DynamicTest> sequencesMatch() {+ Assumptions.assumeTrue(Fixtures.checkpoints() != null,+ Fixtures.missingCheckpoint("english and multilingual"));+ Map<String, Object> fixture = Fixtures.load("sequences.json");+ List<DynamicTest> tests = new ArrayList<>();+ for (String name : List.of("english", "multilingual")) {+ Path model = Fixtures.checkpoint(name);+ Map<String, Object> side = (Map<String, Object>) fixture.get(name);+ if (model == null || side == null || side.containsKey("skipped")) {+ continue;+ }+ Tokenizer tokenizer;+ try {+ tokenizer = Tokenizer.fromModelDirectory(model);+ } catch (IOException failure) {+ throw new IllegalStateException("cannot load " + name, failure);+ }+ Map<String, Object> cases = (Map<String, Object>) side.get("cases");+ for (Map.Entry<String, Object> entry : cases.entrySet()) {+ Map<String, Object> c = (Map<String, Object>) entry.getValue();+ tests.add(DynamicTest.dynamicTest(name + "/" + entry.getKey(),+ () -> check(tokenizer, c)));+ }+ }+ assertTrue(tests.size() > 40, "expected both checkpoints' cases, got " + tests.size());+ return tests;+ }++ @SuppressWarnings("unchecked")+ private static void check(Tokenizer tokenizer, Map<String, Object> c) {+ Question question = questionOf((Map<String, Object>) c.get("question"));+ int[] order = c.get("option_order") == null ? null : Fixtures.ints(c.get("option_order"));+ SequenceBuilder.Sequence built = SequenceBuilder.build(tokenizer, c.get("state"), question,+ ((Number) c.get("max_len")).intValue(),+ ((Number) c.get("head_max_len")).intValue(),+ order, Boolean.TRUE.equals(c.get("truncate_left")), null);++ assertArrayEquals(Fixtures.ints(c.get("ids")), built.ids(), "ids");+ assertArrayEquals(Fixtures.ints(c.get("markers")), built.markers(), "markers");++ Map<String, Object> stats = (Map<String, Object>) c.get("stats");+ assertEquals(((Number) stats.get("options")).intValue(), built.stats().options());+ assertEquals(((Number) stats.get("options_distinct")).intValue(),+ built.stats().optionsDistinct(), "options_distinct");+ Object perOption = stats.get("tokens_per_option");+ assertEquals(perOption == null ? null : ((Number) perOption).intValue(),+ built.stats().tokensPerOption(), "tokens_per_option");++ Map<String, Object> truncation = (Map<String, Object>) c.get("truncation");+ assertEquals(((Number) truncation.get("state_tokens")).intValue(),+ built.truncation().stateTokens(), "state_tokens");+ assertEquals(((Number) truncation.get("state_tokens_used")).intValue(),+ built.truncation().stateTokensUsed(), "state_tokens_used");+ assertEquals(((Number) truncation.get("state_tokens_dropped")).intValue(),+ built.truncation().stateTokensDropped(), "state_tokens_dropped");+ assertEquals(truncation.get("truncated"), built.truncation().truncated(), "truncated");+ }++ @SuppressWarnings("unchecked")+ private static Question questionOf(Map<String, Object> q) {+ String type = (String) q.get("t");+ String instructions = (String) q.get("ins");+ Object criteria = q.get("crit");+ if ("choice".equals(type)) {+ return Question.choice(instructions, (Map<String, Object>) criteria);+ }+ if ("score".equals(type)) {+ return Question.score(instructions, (List<Object>) criteria);+ }+ Map<String, Object> sides = criteria instanceof Map ? (Map<String, Object>) criteria : Map.of();+ Map<String, Object> labels = (Map<String, Object>) q.get("labels");+ Map<String, String> resolved = null;+ if (labels != null) {+ resolved = new LinkedHashMap<>();+ for (Map.Entry<String, Object> label : labels.entrySet()) {+ resolved.put(label.getKey(), (String) label.getValue());+ }+ }+ return Question.noul(instructions, sides.get("false"), sides.get("true"), resolved);+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/tokenizer/TokenizerParityTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/tokenizer/TokenizerParityTest.javanew file mode 100644index 00000000..79963e7b--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/tokenizer/TokenizerParityTest.java@@ -0,0 +1,100 @@+package com.convaiinnovations.laya.tokenizer;++import static org.junit.jupiter.api.Assertions.assertArrayEquals;+import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertTrue;++import com.convaiinnovations.laya.Fixtures;+import java.io.IOException;+import java.nio.file.Path;+import java.util.ArrayList;+import java.util.List;+import java.util.Map;+import org.junit.jupiter.api.Assumptions;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.DynamicTest;+import org.junit.jupiter.api.TestFactory;++/**+ * Token ids against expectations recorded from the real HuggingFace tokenizer.+ *+ * <p>Ids, not answers: a tokenizer divergence that changes an answer is almost impossible to+ * localise from the answer and trivial from the ids.+ *+ * <p>Needs the checkpoints, so it is skipped without them -- and a skip is not a pass, which is why+ * CI asserts a minimum passed count for this class rather than only a zero failure count.+ */+final class TokenizerParityTest {++ @TestFactory+ @DisplayName("every corpus entry is byte-identical, on both checkpoints")+ @SuppressWarnings("unchecked")+ List<DynamicTest> corpusMatches() {+ Assumptions.assumeTrue(Fixtures.checkpoints() != null,+ Fixtures.missingCheckpoint("english and multilingual"));+ Map<String, Object> fixture = Fixtures.load("tokenizer_ids.json");+ Map<String, Object> corpusText = (Map<String, Object>) fixture.get("corpus_text");+ List<DynamicTest> tests = new ArrayList<>();+ for (String name : List.of("english", "multilingual")) {+ Path model = Fixtures.checkpoint(name);+ if (model == null) {+ continue;+ }+ Map<String, Object> side = (Map<String, Object>) fixture.get(name);+ if (side == null || side.containsKey("skipped")) {+ continue;+ }+ Tokenizer tokenizer;+ try {+ tokenizer = Tokenizer.fromModelDirectory(model);+ } catch (IOException failure) {+ throw new IllegalStateException("cannot load " + name, failure);+ }+ tests.add(DynamicTest.dynamicTest(name + "/identity", () -> {+ Map<String, Object> identity = (Map<String, Object>) side.get("identity");+ assertEquals("BPE", identity.get("model_type"));+ // The fixture records what the checkpoint IS, so a fixture generated against a+ // different checkpoint cannot be mistaken for a matching one.+ assertEquals(((Number) identity.get("vocab_size")).intValue()+ + countAdded(side), tokenizer.vocabSize(),+ "vocab plus added tokens");+ }));+ tests.add(DynamicTest.dynamicTest(name + "/specials", () -> {+ Map<String, Object> specials = (Map<String, Object>) side.get("special_ids");+ assertEquals(((Number) specials.get("cls")).intValue(), tokenizer.clsId().orElseThrow());+ assertEquals(((Number) specials.get("sep")).intValue(), tokenizer.sepId().orElseThrow());+ assertEquals(((Number) specials.get("mask")).intValue(), tokenizer.maskId().orElseThrow());+ assertEquals(((Number) specials.get("pad")).intValue(), tokenizer.padId().orElseThrow());+ assertEquals(specials.get("mask_token"), tokenizer.maskToken());+ }));+ Map<String, Object> corpus = (Map<String, Object>) side.get("corpus");+ for (Map.Entry<String, Object> entry : corpus.entrySet()) {+ String text = (String) corpusText.get(entry.getKey());+ int[] want = Fixtures.ints(entry.getValue());+ tests.add(DynamicTest.dynamicTest(name + "/" + entry.getKey(),+ () -> assertArrayEquals(want, tokenizer.encode(text),+ "ids for corpus entry " + entry.getKey())));+ }+ Map<String, Object> truncation = (Map<String, Object>) side.get("option_truncation");+ tests.add(DynamicTest.dynamicTest(name + "/option-truncation-48", () -> {+ String text = " " + truncation.get("text");+ assertArrayEquals(Fixtures.ints(truncation.get("uncapped")),+ tokenizer.encode(text, -1), "uncapped");+ // The cap is applied AT the tokenizer, which must equal slicing the full encoding.+ assertArrayEquals(Fixtures.ints(truncation.get("capped_48")),+ tokenizer.encode(text, 48), "capped at 48");+ }));+ }+ assertTrue(tests.size() > 40, "expected the full corpus, got " + tests.size());+ return tests;+ }++ @SuppressWarnings("unchecked")+ private static int countAdded(Map<String, Object> side) {+ // The fixture's vocab_size counts model.vocab only; the english checkpoint keeps 88 of its+ // added tokens outside it, so the tokenizer's own size is the union.+ Map<String, Object> identity = (Map<String, Object>) side.get("identity");+ Object added = identity.get("added_tokens_outside_vocab");+ return added == null ? 0 : ((Number) added).intValue();+ }+}diff --git a/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/tokenizer/UnicodeWhitespaceTest.java b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/tokenizer/UnicodeWhitespaceTest.javanew file mode 100644index 00000000..03fc7a8c--- /dev/null+++ b/laya-java/laya-java/src/test/java/com/convaiinnovations/laya/tokenizer/UnicodeWhitespaceTest.java@@ -0,0 +1,79 @@+package com.convaiinnovations.laya.tokenizer;++import static org.junit.jupiter.api.Assertions.assertEquals;+import static org.junit.jupiter.api.Assertions.assertFalse;+import static org.junit.jupiter.api.Assertions.assertTrue;++import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;++/**+ * The whitespace predicate an added token's {@code lstrip} uses must be Unicode+ * {@code White_Space}, which is what the reference tokenizer strips -- not Java's+ * {@link Character#isWhitespace}.+ *+ * <p>Eight characters disagree, and the disagreement is observable: with {@code lstrip} set, as+ * both shipped checkpoints set it on their mask token, {@code "a" + U+00A0 + "[MASK]"} tokenized+ * to three ids where the reference gives two.+ */+final class UnicodeWhitespaceTest {++ /** The characters where Java's own predicate and the Unicode property disagree. */+ private static final char[] JAVA_SAYS_SPACE_UNICODE_DOES_NOT =+ {0x001C, 0x001D, 0x001E, 0x001F};+ private static final char[] UNICODE_SAYS_SPACE_JAVA_DOES_NOT =+ {0x0085, 0x00A0, 0x2007, 0x202F};++ @Test+ @DisplayName("the property is the Unicode one, not Java's")+ void disagreesWithJavaExactlyWhereItShould() {+ for (char c : JAVA_SAYS_SPACE_UNICODE_DOES_NOT) {+ assertTrue(Character.isWhitespace(c), "Java calls U+" + hex(c) + " whitespace");+ assertFalse(Unicode.isWhiteSpace(c),+ "U+" + hex(c) + " is not Unicode White_Space and must not be stripped");+ }+ for (char c : UNICODE_SAYS_SPACE_JAVA_DOES_NOT) {+ assertFalse(Character.isWhitespace(c), "Java does not call U+" + hex(c) + " whitespace");+ assertTrue(Unicode.isWhiteSpace(c),+ "U+" + hex(c) + " IS Unicode White_Space and must be stripped");+ }+ }++ @Test+ @DisplayName("the whole White_Space set, and nothing outside it")+ void matchesTheProperty() {+ // The property is 25 code points below U+10000, fixed by the standard.+ int[] expected = {0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x20, 0x85, 0xA0, 0x1680,+ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008,+ 0x2009, 0x200A, 0x2028, 0x2029, 0x202F, 0x205F, 0x3000};+ java.util.Set<Integer> wanted = new java.util.HashSet<>();+ for (int c : expected) {+ wanted.add(c);+ }+ int found = 0;+ for (int c = 0; c <= 0xFFFF; c++) {+ boolean is = Unicode.isWhiteSpace((char) c);+ assertEquals(wanted.contains(c), is, "U+" + hex((char) c));+ if (is) {+ found++;+ }+ }+ assertEquals(expected.length, found);+ }++ @Test+ @DisplayName("alphanumeric follows Rust's rule, which includes the other-number category")+ void alphanumericIncludesOtherNumbers() {+ assertTrue(Unicode.isAlphanumeric('a'));+ assertTrue(Unicode.isAlphanumeric('7'));+ assertTrue(Unicode.isAlphanumeric('½'), "VULGAR FRACTION ONE HALF is No");+ assertTrue(Unicode.isAlphanumeric('²'), "SUPERSCRIPT TWO is No");+ assertTrue(Unicode.isAlphanumeric('中'));+ assertFalse(Unicode.isAlphanumeric(' '));+ assertFalse(Unicode.isAlphanumeric('-'));+ }++ private static String hex(char c) {+ return String.format("%04X", (int) c);+ }+}diff --git a/laya-java/scripts/check_test_results.py b/laya-java/scripts/check_test_results.pynew file mode 100755index 00000000..7408d06c--- /dev/null+++ b/laya-java/scripts/check_test_results.py@@ -0,0 +1,98 @@+#!/usr/bin/env python3+"""Fail a Java test run that only looks green because the model-backed tests never ran.++The checkpoint-backed parity factories abort by assumption when `LAYA_CHECKPOINTS` or+`LAYA_ONNX_GRAPH` is unset, and an aborted test is not a failure to Gradle: a run with a broken+artifacts directory ends with BUILD SUCCESSFUL and zero parity coverage. In CI that turns the whole+lane into a rubber stamp, which is exactly how a wrong answer can sit behind a green suite.++Exits non-zero when++ * any test failed or errored,+ * a test was skipped or aborted and `--allow-aborted` was not passed, or+ * fewer than `--min-tests` tests ran at all -- which catches a filter that matched nothing and a+ factory that silently stopped registering its cases.++Usage:+ # the lane that deliberately has no checkpoints: aborting the parity factories is expected+ python laya-java/scripts/check_test_results.py <results-dir> --min-tests 80 --allow-aborted++ # the lane that exported the checkpoints: nothing may abort+ python laya-java/scripts/check_test_results.py <results-dir> --min-tests 200+"""+import argparse+import glob+import os+import sys+import xml.etree.ElementTree as ElementTree+++def main(argv=None):+ parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])+ parser.add_argument("results", help="a directory of JUnit XML files, or one such file")+ parser.add_argument("--min-tests", type=int, default=1,+ help="fail if fewer than this many tests ran")+ parser.add_argument("--allow-aborted", action="store_true",+ help="permit skipped/aborted tests, for a lane with no checkpoints")+ args = parser.parse_args(argv)++ if os.path.isdir(args.results):+ files = sorted(glob.glob(os.path.join(args.results, "**", "*.xml"), recursive=True))+ else:+ files = [args.results]+ if not files:+ print("check_test_results: no JUnit XML under %r; the test task did not run"+ % args.results, file=sys.stderr)+ return 1++ tests = failures = errors = skipped = 0+ broken, aborted = [], []+ for path in files:+ try:+ root = ElementTree.parse(path).getroot()+ except ElementTree.ParseError as problem:+ print("check_test_results: %s is not valid XML: %s" % (path, problem), file=sys.stderr)+ return 1+ suites = [root] if root.tag == "testsuite" else root.iter("testsuite")+ for suite in suites:+ tests += int(suite.get("tests", 0))+ failures += int(suite.get("failures", 0))+ errors += int(suite.get("errors", 0))+ skipped += int(suite.get("skipped", 0))+ for case in suite.iter("testcase"):+ name = "%s.%s" % (case.get("classname", "?"), case.get("name", "?"))+ if case.find("failure") is not None or case.find("error") is not None:+ broken.append(name)+ elif case.find("skipped") is not None:+ reason = case.find("skipped").get("message") or ""+ aborted.append("%s (%s)" % (name, reason.strip()[:120]))++ print("check_test_results: %d tests, %d failed, %d errored, %d skipped, across %d file(s)"+ % (tests, failures, errors, skipped, len(files)))+ problems = []+ if broken:+ problems.append("%d test(s) failed or errored" % len(broken))+ for name in broken[:20]:+ print(" FAILED " + name, file=sys.stderr)+ if aborted and not args.allow_aborted:+ problems.append("%d test(s) were skipped or aborted" % len(aborted))+ for name in aborted[:20]:+ print(" SKIPPED " + name, file=sys.stderr)+ print(" a checkpoint-backed test that aborts is not a pass: the artifacts were expected "+ "to be present in this lane", file=sys.stderr)+ elif aborted:+ print(" %d test(s) aborted, which this lane allows:" % len(aborted))+ for name in aborted[:5]:+ print(" " + name)+ if tests < args.min_tests:+ problems.append("only %d tests ran, expected at least %d" % (tests, args.min_tests))++ if problems:+ for line in problems:+ print("check_test_results: " + line, file=sys.stderr)+ return 1+ return 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/laya-java/scripts/gen_fixtures.py b/laya-java/scripts/gen_fixtures.pyindex 167a0d9f..e1355f68 100644--- a/laya-java/scripts/gen_fixtures.py+++ b/laya-java/scripts/gen_fixtures.py@@ -204,6 +204,17 @@ def tokenizer_ids():"pre_tokenizer": (raw.get("pre_tokenizer") or {}).get("type"),"normalizer": (raw.get("normalizer") or {}).get("type"),"unk_token": raw["model"].get("unk_token"),+ "added_tokens": len(raw.get("added_tokens") or []),+ # The english checkpoint keeps 88 of its added tokens OUT of `model.vocab`, with+ # ids above the vocabulary's own maximum -- `[MASK]` among them. A port that built+ # its id map from `model.vocab` alone would have no id for masked prediction, so+ # the count is part of the checkpoint's identity rather than a detail.+ "added_tokens_outside_vocab": sum(+ 1 for a in (raw.get("added_tokens") or [])+ if a["content"] not in raw["model"].get("vocab", {})),+ "byte_fallback": raw["model"].get("byte_fallback"),+ "ignore_merges": raw["model"].get("ignore_merges"),+ "fuse_unk": raw["model"].get("fuse_unk"),},"special_ids": {"cls": tok.cls_token_id, "sep": tok.sep_token_id,@@ -504,12 +515,173 @@ def decode_answers():return out+def python_json():+ """CPython's `json.dumps(ensure_ascii=False)` and `round(v, 4)` on values a port gets wrong.++ Needs no checkpoint, so these are the parity tests CI can run without downloading a model.++ Doubles are carried as raw 64-bit patterns rather than as decimal text: the point of the+ fixture is the SPELLING of a double, so round-tripping the operand through a decimal literal+ would lose the very thing being measured.+ """+ import math+ import random+ import struct++ def bits(value):+ return struct.unpack("<Q", struct.pack("<d", value))[0]++ # Values where Java's own spelling differs from Python's, plus the boundaries of the+ # fixed/scientific switch, the subnormal floor, and both infinities.+ hostile = [0.0, -0.0, 1.0, -1.0, 2.0, 0.5, 1.0 / 3, 2.0 / 3, 0.1, 0.2, 0.3,+ 1e-5, 1e-4, 0.0001, 1e15, 1e16, 1e17, 1e23, 1e100, 1e-100, 1e308, 5e-324,+ 2.2250738585072014e-308, 1.7976931348623157e308, 9007199254740993.0,+ 1e7, 1e-3, 123456789.123456789, math.pi, math.e,+ float("inf"), float("-inf"), float("nan")]+ rng = random.Random(1091)+ doubles = list(hostile)+ # Enough random draws to cover the exponent range and the raw bit patterns, kept small enough+ # that the committed file stays reviewable: the hostile list above is what actually+ # discriminates a wrong implementation, and these are the sweep behind it.+ for _ in range(500):+ kind = rng.randrange(3)+ if kind == 0:+ doubles.append(rng.uniform(-1, 1))+ elif kind == 1:+ doubles.append(rng.choice([1, -1]) * 10 ** rng.randint(-320, 300) * rng.random())+ else:+ doubles.append(struct.unpack("<d", struct.pack("<Q", rng.getrandbits(64)))[0])++ quote, back, newline, tab = chr(34), chr(92), chr(10), chr(9)+ structured = [+ {"b": 1, "a": 2, "z": [1, "x", None, True, 2.5]},+ {"nested": {"k": {"deep": [1.5, -0.0]}}},+ ["a", "b" + quote + "c", "d" + back + "e", "f" + newline + "g" + tab + "h",+ chr(0) + chr(31) + chr(1), chr(0x2028) + chr(0x2029), "/",+ chr(0xE9) + chr(0x4E2D) + chr(0x1F600)],+ {chr(0x4E2D) + chr(0x6587): chr(0x503C), "emoji " + chr(0x1F600): [1e16, 1e-05]},+ "a plain string", 123456789012345678901234567890, -7, True, None, [], {},+ ]++ # Rounding: real softmax output, and the exactly-representable halfway values a half-up+ # implementation gets wrong. Both groups are kept separate so a failure says which kind broke.+ rounding = {"softmax": [], "halfway": [], "uniform": []}+ for _ in range(100):+ k = rng.randint(2, 20)+ z = [rng.gauss(0, 2) for _ in range(k)]+ top = max(z)+ exponentials = [math.exp(v - top) for v in z]+ total = sum(exponentials)+ rounding["softmax"].extend(v / total for v in exponentials)+ # Every 53rd step rather than every 7th: the step size does not matter, only that the values+ # are exact halves at the fourth decimal, and roughly a fifth of them discriminate half-up from+ # half-even -- which is ample at this size.+ rounding["halfway"] = [i / 20000.0 for i in range(0, 20000, 53)]+ rounding["uniform"] = [rng.random() for _ in range(300)]++ return {+ "doubles": [{"bits": bits(v), "repr": json.dumps(v)} for v in doubles],+ "structured": [{"value": v, "dumps": json.dumps(v, ensure_ascii=False)}+ for v in structured],+ "round4": {name: [{"bits": bits(v), "r4": round(v, 4)} for v in values]+ for name, values in rounding.items()},+ }+++# States and questions for the model-backed golden. Public question schema, because this one goes+# through `ONNXAgent.predict` rather than straight into `build_sequence`.+PREDICT_CASES = [+ ("billing-mixed", "We were billed twice for March and want a refund today.", None, {+ "intent": {"type": "choice", "instructions": "What does the customer want?",+ "criteria": {"refund": "money back for a duplicate charge",+ "replace": "a replacement unit", "info": "an explanation only"}},+ "urgency": {"type": "score", "instructions": "How urgent is this?",+ "criteria": ["not urgent", "somewhat", "urgent", "critical"]},+ "duplicate": {"type": "noul", "instructions": "The customer was charged more than once."},+ }),+ ("cjk", "\u6211\u4eec\u4e09\u6708\u4efd\u88ab\u91cd\u590d\u6263\u8d39\u4e86\u4e24\u6b21\uff0c\u8bf7\u4eca\u5929\u9000\u8fd8\u3002", "zh", {+ "intent": {"type": "choice", "instructions": "\u5ba2\u6237\u60f3\u8981\u4ec0\u4e48\uff1f",+ "criteria": {"refund": "\u9000\u6b3e", "replace": "\u66f4\u6362"}},+ "holds": {"type": "noul", "instructions": "\u5ba2\u6237\u88ab\u91cd\u590d\u6263\u8d39\u3002"},+ }),+ ("many-options", "The reply was polite but arrived nine days late.", None, {+ "grade": {"type": "choice", "instructions": "Grade the reply.",+ "criteria": {("g%02d" % i): ("grade band number %d" % i) for i in range(14)}},+ }),+ ("structured-state", {"order": 1182, "items": ["widget", "case"], "charged": 2,+ "currency": "NGN", "note": None}, None, {+ "double": {"type": "noul", "instructions": "This order was charged twice."},+ "band": {"type": "score", "instructions": "Rate the severity.",+ "criteria": [{"d": "none"}, "minor", 3]},+ }),+ ("long-state", "evidence sentence number one about the duplicate charge. " * 120, None, {+ "intent": {"type": "choice", "instructions": "What should we do?",+ "criteria": {"refund": "send money back", "escalate": "pass to a human"}},+ }),+ ("unicode-mixed", "Refund \u9000\u6b3e \u0627\u0633\u062a\u0631\u062f\u0627\u062f \u0935\u093e\u092a\u0938\u0940 \U0001f600 now!", "ar", {+ "intent": {"type": "choice", "instructions": "Pick one.",+ "criteria": {"a": "first", "b": "second"}},+ }),+]+++def predict_golden():+ """`ONNXAgent.predict` and `predict_batch` output on a real graph, for the end-to-end gate.++ Needs an exported graph, which this repository does not ship, so it records `skipped` when+ `LAYA_ONNX_GRAPH` is unset and the Java test skips in turn. CI exports the checkpoint and+ regenerates this, the way the .NET lane regenerates its goldens, so a Python-side change shows+ up here as drift rather than as silence.++ The numbers are model-derived and therefore platform-sensitive in their last reported digit.+ The Java test compares structure exactly and probabilities within a stated tolerance; it is the+ test's tolerance that is the gate, not byte equality of this file.+ """+ import os++ graph = os.environ.get("LAYA_ONNX_GRAPH")+ model = os.environ.get("LAYA_PREDICT_MODEL", "multilingual")+ rig = os.environ.get("LAYA_FIXTURE_CHECKPOINTS",+ "/Users/nombauser/Documents/nomba-dev/laya-e2e/checkpoints")+ if not graph or not os.path.exists(graph):+ return {"skipped": "set LAYA_ONNX_GRAPH to an exported laya.onnx to record this family"}+ from laya.onnx_agent import ONNXAgent+ agent = ONNXAgent(os.path.join(rig, model), onnx_path=graph)+ single = {}+ for cid, state, lang, questions in PREDICT_CASES:+ result = agent.predict(state, questions, lang=lang)+ single[cid] = {"state": state, "lang": lang, "questions": questions,+ "model": result["model"], "answers": result["answers"],+ "usage": result["usage"]}+ batch_states = [c[1] for c in PREDICT_CASES] + ["short one", "another short state", ""]+ batch_questions = {+ "intent": {"type": "choice", "instructions": "What should we do?",+ "criteria": {"refund": "send money back", "escalate": "pass to a human",+ "ignore": "no action"}},+ "urgent": {"type": "noul", "instructions": "This needs a human today."},+ }+ batches = []+ for batch_size, sort_by_length in ((None, False), (2, False), (3, True)):+ kwargs = {"sort_by_length": sort_by_length}+ if batch_size is not None:+ kwargs["batch_size"] = batch_size+ results = agent.predict_batch(batch_states, batch_questions, **kwargs)+ batches.append({"batch_size": batch_size, "sort_by_length": sort_by_length,+ "states": batch_states, "questions": batch_questions,+ "results": [{"model": r["model"], "answers": r["answers"],+ "usage": r["usage"]} for r in results]})+ return {"checkpoint": model, "graph": os.path.basename(graph),+ "single": single, "batch": batches}++FAMILIES = {"lang_tables.json": lang_tables,"presets.json": presets,"tokenizer_ids.json": tokenizer_ids,"sequences.json": sequences,"decode.json": decode_answers,+ "python_json.json": python_json,+ "predict.json": predict_golden,}@@ -527,21 +699,54 @@ def render(payload):return json.dumps(payload, indent=2, ensure_ascii=False) + "\n"+def unverifiable(payload):+ """True when regeneration produced nothing but skip markers.++ A family that needs a checkpoint or an exported graph records `{"skipped": ...}` when it cannot+ reach one. That must never be mistaken for data:++ * in write mode it would REPLACE a good committed fixture with a skip marker, so running this+ script on a machine without the checkpoints would silently delete the parity expectations;+ * in `--check` mode it would be reported as drift against the committed file, so the gate would+ fail for the one reason that is not a problem.++ Both are refused below. `--strict` turns "could not verify" into an error, which is what a CI+ lane that DID download the checkpoints should pass -- there, a skip means the download failed.+ """+ if not isinstance(payload, dict):+ return False+ if "skipped" in payload:+ return True+ # ANY section, not all of them. `tokenizer_ids.json` carries a `corpus_text` section that is+ # always present, so requiring every section to be skipped let a payload through whose two+ # per-checkpoint halves were both skip markers -- and the write replaced a 107 KB fixture with+ # a 9 KB one. Partial regeneration is still unsafe to write.+ return any("skipped" in value+ for value in payload.values() if isinstance(value, dict))++def main(argv=None):parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])parser.add_argument("--check", action="store_true",help="do not write; exit 1 if a committed fixture would change")parser.add_argument("--only", action="append", metavar="FILE",help="restrict to one fixture file (repeatable)")+ parser.add_argument("--strict", action="store_true",+ help="treat a family that cannot be regenerated as an error, for a lane "+ "that is supposed to have the checkpoints")args = parser.parse_args(argv)os.makedirs(FIXTURES, exist_ok=True)- stale, written = [], []+ stale, written, unverified = [], [], []for filename, build in sorted(FAMILIES.items()):if args.only and filename not in args.only:continuepath = os.path.join(FIXTURES, filename)- fresh = render(build())+ payload = build()+ fresh = render(payload)+ if unverifiable(payload) and os.path.exists(path):+ unverified.append(filename)+ continueif args.check:try:with open(path, "r", encoding="utf-8") as handle:@@ -556,6 +761,14 @@ def main(argv=None):handle.write(fresh)written.append("%s (%d bytes)" % (filename, len(fresh)))+ for filename in unverified:+ print("gen_fixtures: %s left alone: it needs a checkpoint or an exported graph this run "+ "could not reach" % filename, file=sys.stderr)+ if unverified and args.strict:+ print("gen_fixtures: --strict was asked for, so a family this run could not regenerate is "+ "an error: the checkpoints were expected to be present", file=sys.stderr)+ return 1+if args.check:for line in stale:print("gen_fixtures: " + line, file=sys.stderr)@@ -563,7 +776,8 @@ def main(argv=None):print("gen_fixtures: run laya-java/scripts/gen_fixtures.py and commit the result",file=sys.stderr)return 1- print("gen_fixtures: fixtures match laya")+ print("gen_fixtures: fixtures match laya%s"+ % (" (%d family/families unverified)" % len(unverified) if unverified else ""))return 0for line in written:print("wrote " + line)diff --git a/laya-java/scripts/prepare_checkpoint.py b/laya-java/scripts/prepare_checkpoint.pynew file mode 100755index 00000000..20f5a8a6--- /dev/null+++ b/laya-java/scripts/prepare_checkpoint.py@@ -0,0 +1,102 @@+#!/usr/bin/env python3+"""Download a pinned laya checkpoint and export the fused ONNX graph the Java tests need.++Separated from `gen_fixtures.py` on purpose: the download and the export are the slow, cacheable+part of a CI run (minutes), while regenerating the fixtures from the Python code is the part that+must happen on every commit (seconds). Splitting them lets the workflow cache the first and never+cache the second.++Writes+ <repo>/checkpoints-java/<name>/ the checkpoint, as `Agent.open` expects it+ <repo>/onnx-java/<name>/laya.onnx the fused graph, as `LayaSession.open` expects it++Usage:+ python laya-java/scripts/prepare_checkpoint.py --checkpoint multilingual+"""+import argparse+import os+import shutil+import subprocess+import sys+import time++HERE = os.path.dirname(os.path.abspath(__file__))+REPO = os.path.dirname(os.path.dirname(HERE))++# The same pin the .NET parity lane uses (laya-dotnet/tools/regen_golden.py). Both lanes measure+# the same checkpoint, so they must not drift to different revisions: a port that matched one and+# not the other would look like a port bug.+HF_REPO = "convaiinnovations/laya"+HF_REVISION = "55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851"++# What `Agent.open` reads, plus what the exporter needs to trace the model.+WANTED = ("rl_agent_config.json", "model.safetensors", "config.json",+ "tokenizer.json", "tokenizer/*", "encoder/*")+++def snapshot(name, revision):+ """The pinned checkpoint directory in the Hugging Face cache, downloading on first use."""+ from huggingface_hub import snapshot_download++ sys.path.insert(0, REPO)+ from laya.router import DEFAULT_MODELS++ if name not in DEFAULT_MODELS:+ raise SystemExit("unknown checkpoint %r; laya.router knows %s"+ % (name, sorted(DEFAULT_MODELS)))+ repo, subfolder = DEFAULT_MODELS[name]+ if repo != HF_REPO:+ raise SystemExit(+ "%s now lives in %r, but the pinned revision belongs to %r; update HF_REPO and "+ "HF_REVISION here and in laya-dotnet/tools/regen_golden.py together"+ % (name, repo, HF_REPO))+ prefix = (subfolder + "/") if subfolder else ""+ root = snapshot_download(repo, revision=revision,+ allow_patterns=[prefix + pattern for pattern in WANTED])+ return os.path.join(root, subfolder) if subfolder else root+++def main(argv=None):+ parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])+ parser.add_argument("--checkpoint", required=True, help="english, multilingual, ...")+ parser.add_argument("--revision", default=HF_REVISION)+ parser.add_argument("--force", action="store_true",+ help="re-export even when the graph is already present")+ args = parser.parse_args(argv)++ model_dir = os.path.join(REPO, "checkpoints-java", args.checkpoint)+ graph_dir = os.path.join(REPO, "onnx-java", args.checkpoint)+ graph = os.path.join(graph_dir, "laya.onnx")++ print("downloading %s at %s" % (args.checkpoint, args.revision[:12]), flush=True)+ cached = snapshot(args.checkpoint, args.revision)+ # Copied out of the cache rather than used in place: the cache path contains the revision and+ # the tests take a plain directory, and a copy keeps a cached export from pointing into a+ # directory a later `snapshot_download` may garbage-collect.+ if os.path.exists(model_dir):+ shutil.rmtree(model_dir)+ shutil.copytree(cached, model_dir, symlinks=False)+ print(" checkpoint at %s" % os.path.relpath(model_dir, REPO))++ if os.path.exists(graph) and os.path.getsize(graph) > 0 and not args.force:+ print(" graph already exported at %s (use --force to redo it)"+ % os.path.relpath(graph, REPO))+ return 0++ os.makedirs(graph_dir, exist_ok=True)+ started = time.perf_counter()+ print("exporting the fused graph (this is the slow part)", flush=True)+ # The repository's own exporter, so the graph the Java tests run is the graph laya ships.+ subprocess.run([sys.executable, os.path.join(REPO, "scripts", "export_onnx.py"),+ "--model", model_dir, "--output", graph],+ check=True, cwd=REPO)+ if not os.path.exists(graph) or os.path.getsize(graph) == 0:+ raise SystemExit("the exporter reported success but wrote no graph at %s" % graph)+ print(" %s (%.1f MB) in %.1f s"+ % (os.path.relpath(graph, REPO), os.path.getsize(graph) / 1e6,+ time.perf_counter() - started))+ return 0+++if __name__ == "__main__":+ sys.exit(main())