Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
25dafe8
Carry the ground/label split out to all three bindings
wf9a5m75 Sep 17, 2026
eb14b51
Keep the vendored renderer's version honest
wf9a5m75 Sep 18, 2026
21776e7
Run the tests on every pull request
wf9a5m75 Sep 19, 2026
5787599
Tell the renderer how much screen a tile covers
wf9a5m75 Sep 27, 2026
c0fa498
Hold the renderer alive for the length of a native call
wf9a5m75 Sep 27, 2026
27c27ff
Read a tile's data from the level its screen size belongs to
wf9a5m75 Sep 28, 2026
da79f31
Draw the glyph ranges that arrive without a name
wf9a5m75 Sep 28, 2026
4907e14
Draw the ground the GPU path was losing
wf9a5m75 Sep 28, 2026
1ecad0a
Judge a label against the rivals its neighbour can see
wf9a5m75 Sep 28, 2026
2bf44f7
Let the wasm fixture answer for its neighbours the way a server would
wf9a5m75 Sep 28, 2026
9549040
Decode a magnified source tile once, not once per child
wf9a5m75 Sep 28, 2026
1fb01fb
Hold the iOS renderer alive for the length of a native call
wf9a5m75 Sep 28, 2026
9c5ebcf
Triangulate a magnified source tile once and cut its children out of it
wf9a5m75 Sep 29, 2026
ab620df
Query features in a tile by layer, filter and text
wf9a5m75 Oct 1, 2026
c8332dc
Share concurrent tile decodes and preserve glyphs across tile seams
wf9a5m75 Oct 8, 2026
7079497
fix: avoid pathological vector polygon triangulation
wf9a5m75 Oct 10, 2026
9543e20
Add bounded vector tile caches and bindings
wf9a5m75 Oct 11, 2026
f716cb6
Run the JS tests on Node 22
wf9a5m75 Oct 25, 2026
7d3cac4
Keep the tile caches off the clock on the web
wf9a5m75 Oct 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Test

# このリポジトリは 3 つの SDK が共有する唯一のレンダラなので、ここが壊れると
# android / ios / web が同時に壊れる。にもかかわらず CI が無かった。
#
# 2 つ走らせる。片方だけでは足りないため:
# - cargo test : ラスタライザ・ラベル配置・スタイル解釈(Rust 141 本)
# - bindings/js : wasm 越しの表面。Rust が通っても束縛がずれていれば落ちる
#
# wasm は git 管理外(.gitignore: bindings/js/pkg/)なので、JS テストの前に
# wasm-pack でビルドする必要がある。

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
branches:
- main
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
rust:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
name: cargo test

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-${{ runner.os }}-

- name: Test
run: cargo test --workspace

# clippy はまだゲートにしない。現状 17 件の警告があり、初日から赤い CI は
# 読まれなくなる。掃除してから `-D warnings` を足すこと。

bindings-js:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
name: bindings/js test

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Set up Node
uses: actions/setup-node@v4
with:
# `node --test "test/*.test.mjs"` は Node 21 からグロブを展開する。
# 20 ではパターンをそのままファイル名として探し、見つからずに落ちる。
node-version: 22

- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
target
key: cargo-wasm-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-wasm-${{ runner.os }}-

# cargo で入れる。サードパーティ action も curl | sh も使わない — この
# ワークフローは 3 つの SDK が信頼するバイナリを作る側なので、取り込む
# ものは少ないほどよい。~/.cargo/bin をキャッシュするので 2 回目以降は速い。
- name: Install wasm-pack
run: command -v wasm-pack || cargo install wasm-pack --locked

- name: Install
working-directory: bindings/js
run: npm ci

# `npm run build` は wasm と JS の両方。テストは pkg/ を直接読むので、
# ここを飛ばすと「モジュールが見つからない」で落ちる。
- name: Build
working-directory: bindings/js
run: npm run build

- name: Typecheck
working-directory: bindings/js
run: npm run typecheck

- name: Test
working-directory: bindings/js
run: npm test
54 changes: 54 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
resolver = "2"
members = [
"crates/mvt-render",
"crates/mvt-style",
"crates/mvt-style-jni",
"crates/mvt-style-ffi",
"crates/mvt-style-wasm",
"crates/tile-png",
"crates/tile-png-jni",
"crates/tile-png-ffi",
Expand Down Expand Up @@ -48,3 +52,10 @@ opt-level = 3

[profile.release.package.miniz_oxide]
opt-level = 3

# Android renders on the device's critical path. Keep the size-first release
# profile for other consumers, but optimize native Android rendering for speed.
# Pixel 5a measurements and reproduction steps: docs/android-performance.md.
[profile.android-release]
inherits = "release"
opt-level = 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.mapconductor.vectorstyle

/**
* The JNI surface of the vector style compiler.
*
* Owned by the `mapconductor-vectortile` repository and copied here by its
* `scripts/sync-sdk.sh`. **Do not edit this file in the SDK**: the next sync
* puts the upstream copy back, silently, and the change goes with it.
*
* Two calls, both JSON in and JSON out. The whole surface is this small
* because the compiler holds no state -- a style and a rule set go in, an
* adjusted style and the deltas come out -- so there is no handle to open or
* free, and no thread the calls have to be made on.
*/
internal object NativeStyleCompiler {
init {
System.loadLibrary("mvt_style_jni")
}

/**
* The compiled result as JSON: the adjusted style, the mutations, what
* they affect and the diagnostics -- or `{"error": "..."}` when a
* document could not be read.
*
* A document that cannot be read is answered, not thrown: a rule set
* from a server or a style that failed to load is an ordinary thing to
* handle, not an exceptional one. Only a panic becomes an exception.
*/
external fun nativeCompile(
styleJson: String,
rulesJson: String,
): String

/** The style's layers and the role each would be given, as a JSON array. */
external fun nativeDescribe(styleJson: String): String

/**
* The rules document version this library understands.
*
* Read when the Kotlin side writes a rules document, so the two can
* never disagree about the shape they are exchanging.
*/
external fun nativeSchemaVersion(): Int
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading