Skip to content

Compare OASIS property values strictly before writing them as repeated - #2508

Closed
nikosavola wants to merge 2 commits into
KLayout:masterfrom
nikosavola:pr-oasis-prop-repeat
Closed

nikosavola wants to merge 2 commits into
KLayout:masterfrom
nikosavola:pr-oasis-prop-repeat

Conversation

@nikosavola

@nikosavola nikosavola commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2507

The OASIS writer can write a property value as "same as the last one" to save space. It used Variant::operator== to check this. That operator compares integers as doubles and allows a small tolerance. So values like $2^{56}$ and $2^{56}-1$, or $10^{13}$ and $10^{13}+1$, counted as equal. The same was true for $5$ and $5.0$. The second shape then got the value of the first one when the file was read back.

The writer now compares each value with Variant::equal. This needs the same type and an exact match for integers. Doubles still use the small tolerance. The properties repository does the same.

The new test writes pairs of shapes with these values and reads them back. It checks that each shape keeps its value and that integers stay integers. It fails on master and passes with the fix.

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.

OASIS writer gives a shape the previous shape's property value when the values are nearly equal

1 participant