fix: localize retained segment source invalidation
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled

This commit is contained in:
tei
2026-10-06 17:18:09 +09:00
parent c4b481fd2c
commit 524aaf4af5
16 changed files with 1736 additions and 71 deletions

View File

@@ -122,6 +122,10 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
if (step099Tick % 2L == 0L) {
updateStep099GeoJson(Step099ReadinessFixture.DYNAMIC_SOURCE, step099Tick)
refreshStep099Diagnostics(log = true)
if (step099Tick == 8L || step099Tick == 130L) {
Log.i(TAG, "STEP100_WINDOW_MARKER phase=${if (step099Tick == 8L) "baseline" else "final"} " +
"tick=$step099Tick sourceId=${Step099ReadinessFixture.DYNAMIC_SOURCE}")
}
}
}
else -> if (step099Tick % 2L == 0L) refreshStep099Diagnostics(log = true)
@@ -675,7 +679,12 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
} else {
"cache=${cache.optString("cacheState")}@${cache.optLong("contentRevision")}" +
" b=${cache.optLong("build")} r=${cache.optLong("reuse")}" +
" i=${cache.optLong("invalidation")}/${cache.optString("lastInvalidationReason")}"
" i=${cache.optLong("invalidation")}/${cache.optString("lastInvalidationReason")}" +
" srcRev=${cache.optLong("sourceRevision")}" +
" ready=${cache.optBoolean("sourceReady")}/${cache.optBoolean("sourceStable")}" +
" supported=${cache.optBoolean("supported")}" +
" decision=${cache.optString("finalDecision")}" +
" fallback=${cache.optLong("fallbackCount")}/${cache.optString("lastFallbackReason")}"
}
add("${segment.optInt("segmentIndex")}:${segment.optString("strategy")}" +
"[${segment.optInt("beginIndex")},${segment.optInt("endExclusive")})" +

View File

@@ -3,7 +3,7 @@ package org.maplibre.android.testapp.activity.particle
import org.json.JSONArray
import org.json.JSONObject
/** STEP-099 offline readiness/invalidation fixtures. Diagnostics only; no renderer semantics are changed. */
/** STEP-099/100 offline source readiness and retained segment fixtures. */
internal object Step099ReadinessFixture {
enum class Scenario(val label: String) {
T1_STATIC("T1 STATIC"),
@@ -14,6 +14,7 @@ internal object Step099ReadinessFixture {
const val PARTICLE_SOURCE = "particle-fixture"
const val STATIC_SOURCE = "step099-static"
const val UPPER_STATIC_SOURCE = "step099-upper-static"
const val DYNAMIC_SOURCE = "step099-dynamic"
const val DYNAMIC_SOURCE_B = "step099-dynamic-b"
const val UNREADY_SOURCE = "step099-unready-raster-array"
@@ -41,6 +42,11 @@ internal object Step099ReadinessFixture {
"""{"type":"Point","coordinates":[135.0,28.0]}"""
))
}
if (scenario == Scenario.T1_STATIC || scenario == Scenario.T3_PERMANENT_UNREADY) {
sources.put(UPPER_STATIC_SOURCE, geoJsonSource(
"""{"type":"Polygon","coordinates":[[[116,4],[154,4],[154,52],[116,52],[116,4]]]}"""
))
}
if (scenario == Scenario.T2_GEOJSON_1HZ) {
sources.put(DYNAMIC_SOURCE_B, geoJsonSource(
"""{"type":"Point","coordinates":[136.0,29.0]}"""
@@ -100,11 +106,13 @@ internal object Step099ReadinessFixture {
.put("circle-color", "#ff6600")
.put("circle-opacity", 0.90)))
}
layers.put(JSONObject()
.put("id", UPPER_STATIC_LAYER)
.put("type", "fill")
.put("source", STATIC_SOURCE)
.put("paint", JSONObject().put("fill-color", "#d3a640").put("fill-opacity", 0.38)))
if (scenario == Scenario.T1_STATIC || scenario == Scenario.T3_PERMANENT_UNREADY) {
layers.put(JSONObject()
.put("id", UPPER_STATIC_LAYER)
.put("type", "fill")
.put("source", UPPER_STATIC_SOURCE)
.put("paint", JSONObject().put("fill-color", "#d3a640").put("fill-opacity", 0.38)))
}
return JSONObject()
.put("version", 8)