[Webkit-unassigned] [Bug 200746] New: [WHLSL] We should not compare int and uint

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 14 17:47:31 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=200746

            Bug ID: 200746
           Summary: [WHLSL] We should not compare int and uint
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebGPU
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sbarati at apple.com
                CC: dino at apple.com, fpizlo at apple.com, jonlee at apple.com,
                    justin_fan at apple.com, mmaxfield at apple.com,
                    rmorisset at apple.com, sam at webkit.org

this is a worrisome  warning:

program_source:363:26: warning: comparison of integers of different signs: 'type47' (aka 'int') and 'uint32_t' (aka 'unsigned int')
variable85 = (variable84 < variable78.length) ?  &(variable78.pointer[variable84]) : nullptr;


```
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>Test prefix/postfix.</title>
<script src="js/test-harness.js"></script>
<script src="../js/webgpu-functions.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
const whlslTests = {};
const epsilon = 0.0001;

whlslTests.vectorTimes = async () => {
    const program = `
        float foo() {
            float2 x = float2(2, 5);
            float2 y = float2(3, 10);
            float2 r = y * x;
            return r.x / r.y;
        }
    `;
    assert_approx_equals(await callFloatFunction(program, "foo", []), 6/50, epsilon);
};

whlslTests.vectorTimesWithScalar = async () => {
    const program = `
        float foo() {
            float2 x = float2(10, 20);
            float2 r = x * 2.0;
            return r.x * r.y;
        }
    `;
    assert_approx_equals(await callFloatFunction(program, "foo", []), 20 * 40, epsilon);
};

whlslTests.vectorTimesWithScalar2 = async () => {
    const program = `
        float foo() {
            float2 x = float2(10, 20);
            float2 r = 2.0 * x;
            return r.x * r.y;
        }
    `;
    assert_approx_equals(await callFloatFunction(program, "foo", []), 20 * 40, epsilon);
};

whlslTests.matrixTimes = async () => {
    const program = `
        bool foo() {
            float2x2 m;
            m[0] = float2(20, 30);
            m[1] = float2(40, 50);

            float2x2 m2;
            m2[0] = float2(-1.0, -1.0);
            m2[1] = float2(-1.0, -1.0);

            m = m * m2;

            if (m[0][0] == -20.0 && m[0][1] == -30.0 && m[1][0] == -40.0 && m[1][1] == -50.0)
                return true;
            return false;
        }
    `;
    assert_equals(await callBoolFunction(program,  "foo", []), true);
};

whlslTests.matrixTimesScalar = async () => {
    const program = `
        bool foo() {
            float2x2 m;
            m[0] = float2(20, 30);
            m[1] = float2(40, 50);

            m = m * -1.0;

            if (m[0][0] == -20.0 && m[0][1] == -30.0 && m[1][0] == -40.0 && m[1][1] == -50.0)
                return true;
            return false;
        }
    `;
    assert_equals(await callBoolFunction(program,  "foo", []), true);
};

runTests(whlslTests);
</script>
</html>
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190815/1c2590ad/attachment-0001.html>


More information about the webkit-unassigned mailing list