Skip to content

TextRenderer TypeError (nil into Float) skips SVG for ~8% of PLATEAU CG3 diagrams and crashes ea svg --all #51

Description

@ronaldtse

Summary

Ea::Svg::EaEmitter::TextRenderer raises TypeError: can't convert nil into Float for a subset of real-world diagrams. When hit via ea svg / ea render / ea svg --all it aborts the whole command; when hit during SPA generation it aborts the entire ea spa build (this is now rescued per-diagram in the SPA projector as of #50, at the cost of silently degrading those diagrams to metadata-only views).

Reproduction

Source model: models/20260323_CityGML_3.0_Consolidated_Draft.qea (45 MB QEA, PLATEAU CityGML 3.0 Consolidated Draft) in https://github.com/metanorma/plateau-models — 3,702 diagrams, of which 297 (8%) fail with this error.

Single-diagram repro (any of these ids):

ea svg FFE644BA-D299-4628-8668-06F25CBC1BEB models/20260323_CityGML_3.0_Consolidated_Draft.qea   # "Profile D5. Country profile Japan"
ea svg FF845DA9-C080-47d5-B4AF-EB6B734F8836 models/20260323_CityGML_3.0_Consolidated_Draft.qea   # "SD_SensorModel (1)"
ea svg FED84566-DFB3-4a3c-B325-8B347EC4CC1C models/20260323_CityGML_3.0_Consolidated_Draft.qea   # "Radiometry"

Full-scale (crashes mid-run, unrescued):

ea spa models/20260323_CityGML_3.0_Consolidated_Draft.qea --mode=sharded -o out
ea svg --all models/20260323_CityGML_3.0_Consolidated_Draft.qea

Stack

TypeError: can't convert nil into Float
  lib/ea/svg/ea_emitter/text_renderer.rb:59:in 'Kernel#format'

The failing call is a format with a numeric field fed by diagram element/label data where a geometry or font metric comes through as nil (observed on ea 0.6.4, Ruby 3.4). Element-level data in the failing shards looks structurally normal apart from the nil that reaches the format.

Impact

  • ea spa (sharded + single_file): 297/3,702 CG3 diagrams ship without an SVG canvas (stderr warning per diagram, e.g. ea: skipping SVG render for diagram ... (…) : TypeError: can't convert nil into Float).
  • ea svg / ea render / ea svg --all: hard failure on any affected diagram.

Suggested direction

Nil-guard the numeric inputs at the text_renderer.rb:59 format call (defaulting to EA-equivalent fallbacks), and/or emit a clearer per-diagnostic naming the offending element/attribute so upstream QEA data issues can be traced.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions