Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on mobile #507

Open
gustav-langer opened this issue Nov 9, 2023 · 2 comments
Open

Crash on mobile #507

gustav-langer opened this issue Nov 9, 2023 · 2 comments

Comments

@gustav-langer
Copy link

This is a modified version of Quirk, used for this online course.
It runs fine on my laptop (Windows 10, Microsoft Edge), but is unusable on my phone (Android 8, Chrome)

Error Message:


Defaulted to NaN results. Computing circuit values failed.

URL
https://www.quantum-quest.org/quirky/QuirkyQuest1.html

BROWSER
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Netscape
5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36

RECOVERY DETAILS
{"circuitDefinition": {"cols": []}}

ERROR OBJECT
Error: WebGLShader: Shader compile failed.
Info: 0:1: S0033: no default precision defined for function 's1605'�
Source:
precision highp float;
precision highp int;

    ///////////// makeFloatCoderOutput2 ////////////
    vec2 outputFor(float k);

    uniform vec2 _gen_output_size;
    uniform float _gen_secret_half;

    float len_output() {
        return _gen_output_size.x * _gen_output_size.y;
    }

//////// body ////////

uniform float state;
vec2 outputFor(float k) {
    return vec2(float(k == state), 0.0);
}

void main() {
vec2 xy = gl_FragCoord.xy - vec2(_gen_secret_half, _gen_secret_half);
float k = xy.y * _gen_output_size.x + xy.x;

        vec2 v = outputFor(k);

        gl_FragColor = vec4(v.x, v.y, 0.0, 0.0);
    }

ERROR LOCATION
Error: WebGLShader: Shader compile failed.
Info: 0:1: S0033: no default precision defined for function 's1605'�
Source:
precision highp float;
precision highp int;

    ///////////// makeFloatCoderOutput2 ////////////
    vec2 outputFor(float k);

    uniform vec2 _gen_output_size;
    uniform float _gen_secret_half;

    float len_output() {
        return _gen_output_size.x * _gen_output_size.y;
    }

//////// body ////////

uniform float state;
vec2 outputFor(float k) {
    return vec2(float(k == state), 0.0);
}

void main() {
vec2 xy = gl_FragCoord.xy - vec2(_gen_secret_half, _gen_secret_half);
float k = xy.y * _gen_output_size.x + xy.x;

        vec2 v = outputFor(k);

        gl_FragColor = vec4(v.x, v.y, 0.0, 0.0);
    }
at Function.compileShader (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:540743)
at new i (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:538993)
at $traceurRuntime.createClass.initializedValue.initializer (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:537819)
at $traceurRuntime.createClass.initializedValue.initializedValue (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:535541)
at e.renderToFunc (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:538149)
at e.renderTo (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:531249)
at e.renderToFunc (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:519273)
at e.renderTo (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:531249)
at e._renderToElseDealloc (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:531414)
at e.toVec2Texture (https://www.quantum-quest.org/quirky/QuirkyQuest1.html:317:532672)
@gustav-langer
Copy link
Author

gustav-langer commented Nov 9, 2023

Update: I get the same issue with the unmodified Quirk version listed on this repo, http://algassert.com/quirk .

@Strilanc
Copy link
Owner

Strilanc commented Nov 9, 2023

This crash makes no sense to me, as the first line of the shader source that's failing to compile specifies the precision that the error says it is not specifying. Some searching on the internet suggests that maybe I need to check for GL_FRAGMENT_PRECISION_HIGH to use precision highp float, but if high precision isn't available the simulation is very likely to return incorrect results (precision affects not just floats but index calculations used for picking what data to combine). So I suspect the fix for this issue would look like Quirk saying "Oh no! You need a newer android for this to work!" rather than actually working...

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

No branches or pull requests

2 participants