From e2991785277649706afc69adc26a8df2841804e8 Mon Sep 17 00:00:00 2001 From: U9G Date: Thu, 27 Aug 2026 01:44:20 -0400 Subject: [PATCH] Remove uniqueItems from blockStates schema Ajv 6 checks uniqueItems on object arrays with a pairwise deep-equal loop, which is O(n^2). blockStates.json files have ~17k entries, so each of the 29 bedrock versions took 12-36s to validate (~425s of a ~9min CI run); the same file validates in ~11ms without it. Uniqueness of generated block state entries is not an invariant we rely on. --- schemas/blockStates_schema.json | 1 - tools/js/test/test.js | 2 -- 2 files changed, 3 deletions(-) diff --git a/schemas/blockStates_schema.json b/schemas/blockStates_schema.json index 9056081b3..f3e4aa1ae 100644 --- a/schemas/blockStates_schema.json +++ b/schemas/blockStates_schema.json @@ -1,7 +1,6 @@ { "title": "blockStates", "type": "array", - "uniqueItems": true, "items": { "title": "blockState", "type": "object", diff --git a/tools/js/test/test.js b/tools/js/test/test.js index 2e886e557..d9a3a8bae 100644 --- a/tools/js/test/test.js +++ b/tools/js/test/test.js @@ -24,8 +24,6 @@ require('./version_iterator')(function (p, versionString) { } if (instance) { it(dataName + '.json is valid', function () { - // blockStates.json files are large (10k+ entries); give them more time - if (dataName === 'blockStates') this.timeout(180 * 1000) // Skip tints schema validation for PC 1.21.4, as it doesn't meet the // maxItems: 1 check for the constant tints. if (dataName === 'tints' && versionString === 'pc 1.21.4') {