Skip to content

Speed up linting of default and examples#637

Merged
jviotti merged 4 commits intomainfrom
all-deps-fast
Feb 2, 2026
Merged

Speed up linting of default and examples#637
jviotti merged 4 commits intomainfrom
all-deps-fast

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Jan 30, 2026

See: #629
Signed-off-by: Juan Cruz Viotti jv@jviotti.com

See: #629
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode
Copy link

augmentcode bot commented Jan 30, 2026

🤖 Augment PR Summary

Summary: Speeds up linting by avoiding work on schema locations/references that cannot be reached during validation.

Changes:

  • Bumped vendored dependency SHAs for core, blaze, jsonbinpack, and codegen.
  • Added a pointer→location index inside SchemaFrame to make pointer-based traverse() and URI lookup faster.
  • Introduced reachability analysis (SchemaFrame::is_reachable) with lazy caching, and used it to skip compiling unreachable reference targets in Blaze.
  • Refactored the OrphanDefinitions alter-schema rule to use reachability (and reachable refs-through) instead of scanning ref sets.
  • Extended the codegen IR with IRAny so boolean-true schemas compile; TypeScript now emits unknown for that case.
  • Updated unordered container usage to rely on explicit Pointer/WeakPointer hashers/comparators instead of a global std::hash specialization.

Technical Notes: SchemaFrame is now non-copyable/non-movable due to internal caches storing references into frame-owned data.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


SchemaFrame(const Mode mode) : mode_{mode} {}

// We rely on internal caches that would be dangling otherwise
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making SchemaFrame non-copyable/non-movable is an API-breaking change for any downstream code that stores/returns it by value; please double-check that this is acceptable for the public surface of core.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

auto SchemaFrame::populate_reachability(const SchemaWalker &walker,
const SchemaResolver &resolver) const
-> void {
if (!this->reachability_.empty()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

populate_reachability() memoizes into reachability_ without considering the walker/resolver arguments, so is_reachable() could return stale results if a SchemaFrame is queried with different resolver/walker instances. Is the intended contract that SchemaFrame is only ever used with the same walker/resolver (e.g., the ones used during analyse())?

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

return this->data < other.get().data;
}

/// Hash functor for use with containers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the hash implementation now living in GenericPointer::Hasher, dropping the std::hash<GenericPointer<...>> specialization can be a breaking change for downstream users of unordered_*<Pointer> that relied on the default hasher. If this is intended, it may be worth explicitly documenting/calling out in release notes.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

continue;
}

auto reference_origin{frame.traverse(reference.first.second)};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code assumes frame.traverse(reference.first.second) (and the parent traversals) can never return std::nullopt; in NDEBUG builds the assert()s compile out and reference_origin->get() would be UB if the invariant is violated. If unresolved/missing locations are possible here, consider guarding the optional before dereferencing.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
See: #629
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit c40dc36 into main Feb 2, 2026
13 checks passed
@jviotti jviotti deleted the all-deps-fast branch February 2, 2026 16:06
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 15, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [sourcemeta/jsonschema](https://github.com/sourcemeta/jsonschema) | minor | `v14.5.0` → `v14.10.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>sourcemeta/jsonschema (sourcemeta/jsonschema)</summary>

### [`v14.10.0`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.10.0)

[Compare Source](sourcemeta/jsonschema@v14.9.0...v14.10.0)

#### What's Changed

- Implement a `--frozen` option for the `install` command by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;656](sourcemeta/jsonschema#656)

**Full Changelog**: <sourcemeta/jsonschema@v14.9.0...v14.10.0>

### [`v14.9.0`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.9.0)

[Compare Source](sourcemeta/jsonschema@v14.8.0...v14.9.0)

#### What's Changed

- Support adding new dependencies in `install` by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;655](sourcemeta/jsonschema#655)

**Full Changelog**: <sourcemeta/jsonschema@v14.8.0...v14.9.0>

### [`v14.8.0`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.8.0)

[Compare Source](sourcemeta/jsonschema@v14.7.2...v14.8.0)

#### What's Changed

- Implement an `install` command by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;654](sourcemeta/jsonschema#654)
  - Note: this is a first take on the problem. More improvements coming very soon!

**Full Changelog**: <sourcemeta/jsonschema@v14.7.2...v14.8.0>

### [`v14.7.2`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.7.2)

[Compare Source](sourcemeta/jsonschema@v14.7.1...v14.7.2)

#### What's Changed

- Improve I/O error handling for when dealing with FUSE filesystems by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;651](sourcemeta/jsonschema#651)

**Full Changelog**: <sourcemeta/jsonschema@v14.7.1...v14.7.2>

### [`v14.7.1`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.7.1)

[Compare Source](sourcemeta/jsonschema@v14.7.0...v14.7.1)

#### What's Changed

- Speed up `default`/`examples` linting on standalone schemas by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;647](sourcemeta/jsonschema#647)
- Publish the `musl` x86-64 binary to NPM by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;649](sourcemeta/jsonschema#649)

**Full Changelog**: <sourcemeta/jsonschema@v14.7.0...v14.7.1>

### [`v14.7.0`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.7.0)

[Compare Source](sourcemeta/jsonschema@v14.6.1...v14.7.0)

#### What's Changed

- Support formatting in the `lint` command using `--format` by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;642](sourcemeta/jsonschema#642)
- Print simple progress status when running `lint --fix` by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;644](sourcemeta/jsonschema#644)
- Support compiling a specific subschema in `compile` and `validate` by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;646](sourcemeta/jsonschema#646)

**Full Changelog**: <sourcemeta/jsonschema@v14.6.1...v14.7.0>

### [`v14.6.1`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.6.1)

[Compare Source](sourcemeta/jsonschema@v14.6.0...v14.6.1)

#### What's Changed

- Fix a lint `$dynamicAnchor` crash introduced in previous optimisations by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;640](sourcemeta/jsonschema#640)

**Full Changelog**: <sourcemeta/jsonschema@v14.6.0...v14.6.1>

### [`v14.6.0`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.6.0)

[Compare Source](sourcemeta/jsonschema@v14.5.0...v14.6.0)

#### What's Changed

- Remove NPM `postinstall` script as newer version of NPM no longer print the message by [@&#8203;Karan-Palan](https://github.com/Karan-Palan) in [#&#8203;633](sourcemeta/jsonschema#633)
- Do not report non-fixable rules multiple times on `lint --fix` and add various new linter rules by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;634](sourcemeta/jsonschema#634)
- Optimise `lint --fix` to avoid re-analysing the schema in vain by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;635](sourcemeta/jsonschema#635)
- Mark orphaned locations in the `inspect` command as `orphan` by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;636](sourcemeta/jsonschema#636)
- Speed up linting of `default` and `examples` by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;637](sourcemeta/jsonschema#637)
- Speed up schema compilation, linting, and bundling by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;638](sourcemeta/jsonschema#638)

**Full Changelog**: <sourcemeta/jsonschema@v14.5.0...v14.6.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Ni4yIiwidXBkYXRlZEluVmVyIjoiNDIuOTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant