question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[instancer] _instantiateFeatureVariations() limitation when a range rule becomes applicable

See original GitHub issue

With current logic, it’s possible that, as a result of pinning one axis, a rule becomes default-applicable, but we do not apply it by default. That is wrong.

Let me take an example from the test suite’s InstantiateFeatureVariationsTest::test_partial_instance, second test. Imagine the font has these rules:

        font = makeFeatureVarsFont( 
            [ 
                ([{"wght": (0.20886, 1.0)}], {"uni0024": "uni0024.nostroke"}), 
                ([{"cntr": (0.75, 1.0)}], {"uni0041": "uni0061"}), 
                ( 
                    [{"wght": (-1.0, -0.45654), "cntr": (0, 0.25)}], 
                    {"uni0061": "uni0041"}, 
                ), 
            ] 
        ) 

Now if we pin {"wght": -1.0}, currently the test suite says no appliedSub, and the following expectedRecords:

                [ 
                    ({"cntr": (0, 0.25)}, {"uni0061": "uni0041"}), 
                    ({"cntr": (0.75, 1.0)}, {"uni0041": "uni0061"}), 
                ], 

However, this is wrong. Because now the rule ({"cntr": (0, 0.25)}, {"uni0061": "uni0041"}) is default-applicable because it starts at 0, so we should also copy its substitution into appliedSub.

But if we do that, the appliedSub will be applied to the entire space. So we then need to disable that at the end with a catch-all rule. That is:

                [ 
                    ({"cntr": (0, 0.25)}, {"uni0061": "uni0041"}), 
                    ({"cntr": (0.75, 1.0)}, {"uni0041": "uni0061"}), 
                    ({}, {}),
                ], 

Fixing this is hard but doable. I can do it but I prefer to do after merging the L4 branch.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
anthrotypecommented, Aug 18, 2022

most implementations do NOT process variation-specific tables at the default-instance (0) location

I see… that’s the part I was missing…

0reactions
behdadcommented, Oct 31, 2022

I like to attack this one soon. Need to get in the zone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5.5 Decision Rules | Interpretable Machine Learning
A decision rule uses at least one feature=value statement in the condition, with no upper limit on how many more can be added...
Read more >
A Guide to the Rulemaking Process - Federal Register
When do final rules go into effect? Can an agency issue a final rule without a publishing a proposed rule? What are interim...
Read more >
Configure clusters | Databricks on AWS
A cluster policy limits the ability to configure clusters based on a set of rules. The policy rules limit the attributes or attribute...
Read more >
Replace Auto Scaling instances based on an instance refresh
Learn how to replace the Amazon EC2 instances in your Auto Scaling group, based on an instance refresh.
Read more >
Using media queries - CSS: Cascading Style Sheets | MDN
For instance, this @media rule uses two media queries to target both ... Many media features are range features, which means they can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found