~radgerayden

Trackers

~radgerayden/patchtesting

Last active 11 months ago

#11 under certain circumstances, an Rc copy can become corrupted 6 months ago

Comment by ~radgerayden on ~duangle/scopes

Doesn't reproduce anymore. Probably fixed together with #12.

REPORTED RESOLVED FIXED

#12 premature lifetime end inside label 6 months ago

Comment by ~radgerayden on ~duangle/scopes

Fixed in rev 2304 and 2305.

REPORTED RESOLVED FIXED

#13 swizzle of a reference of a glm vector yields incorrect type. 6 months ago

on ~duangle/scopes

REPORTED RESOLVED BY_DESIGN

#16 std::bad_alloc in switch codegen 7 months ago

Ticket created by ~radgerayden on ~duangle/scopes

repro:

# was only able to repro with this combination of one
# case, one pass and a repeated pass. Order doesn't seem to matter.
switch 10
pass 3
pass 3
do
    ;
case 1
    ;
pass 2
do
    ;
default
    ;
#
    terminate called after throwing an instance of 'std::bad_alloc'
    what():  std::bad_alloc
    Stack dump:
    0.      Running pass 'Function Pass Manager' on module '/home/[redacted]/backend-abort-repro.sc:3'.
    1.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@"/home/[redacted]/backend-abort-repro.sc:3<>$f1f7646c81ab64326_2"'

#15 When using GLSL version 420, spir-v generator doesn't insert GL_ARB_shader_storage_buffer_object extension 7 months ago

Ticket created by ~radgerayden on ~duangle/scopes

repro:

fn vertex ()
    using import glsl
    using import glm
    buffer attr :
        struct Attributes plain
            data : (array vec2)
    gl_Position = (vec4 (attr.data @ gl_VertexID) 0 1)
fn fragment ()
    using import glsl
    using import glm
    out fcolor : vec4
    fcolor = (vec4 1)
    
# use your own link-shader fn here
let program = 
    link-shader
        static-compile-glsl 420 'vertex (static-typify vertex)
        static-compile-glsl 420 'fragment (static-typify fragment)
        
# will yield this runtime (OpenGL) error:
#0:3(16): error: syntax error, unexpected NEW_IDENTIFIER

# it can be solved by patching in (inserts after the #version line):
let vsource =
    patch-shader
        static-compile-glsl 420 'vertex (static-typify vertex)
        "#extension GL_ARB_shader_storage_buffer_object : require\n"

#14 [PATCH] core: countof constant string is constant 7 months ago

on ~duangle/scopes

REPORTED RESOLVED IMPLEMENTED

#14 [PATCH] core: countof constant string is constant 7 months ago

Ticket created by ~radgerayden on ~duangle/scopes

# HG changeset patch
# User Westerbly Snaydley <westerbly@gmail.com>
# Date 1607926470 18000
#      Mon Dec 14 01:14:30 2020 -0500
# Node ID c8b28f01678c8685fbbd773ad09ffa3312c46580
# Parent  7c4d7e4ebbfe8e4bfb91225cc39d763b4201cf2b
core: countof constant string is constant

diff -r 7c4d7e4ebbfe -r c8b28f01678c lib/scopes/core.sc
--- a/lib/scopes/core.sc	Fri Dec 11 15:31:09 2020 +0100
+++ b/lib/scopes/core.sc	Mon Dec 14 01:14:30 2020 -0500
@@ -2018,7 +2018,6 @@
 
 'define-symbols string
     buffer = sc_string_buffer
-    __countof = sc_string_count
     __@ = string@
     __lslice = sc_string_lslice
     __rslice = sc_string_rslice
@@ -2032,6 +2031,19 @@
     __<= = (box-pointer (simple-binary-op (inline (a b) (icmp<=s (sc_string_compare a b) 0))))
     __> = (box-pointer (simple-binary-op (inline (a b) (icmp>s (sc_string_compare a b) 0))))
     __>= = (box-pointer (simple-binary-op (inline (a b) (icmp>=s (sc_string_compare a b) 0))))
+    __countof =
+        box-pointer
+            spice-macro
+                fn (args)
+                    let argc = (sc_argcount args)
+                    verify-count argc 1 1
+                    let self = (sc_getarg args 0)
+                    if ('constant? self)
+                        let count =
+                            sc_string_count (unbox self string)
+                        `count
+                    else
+                        `(sc_string_count self)
 
 'define-symbols list
     __typecall = list-constructor

#13 swizzle of a reference of a glm vector yields incorrect type. 8 months ago

Ticket created by ~radgerayden on ~duangle/scopes

repro:

using import testing
using import glm

let v1 = (vec4)
test
    (typeof v1.st) == vec2

local v2 : vec4
dump (typeof v2.st) # vec4(vectorof i32 0 1)
test
    (typeof v2.st) == vec2

#12 premature lifetime end inside label 9 months ago

Ticket created by ~radgerayden on ~duangle/scopes

repro:

using import Box
using import testing

# I use Box here, but seems to happen with any lifetime checked type.
let T = (Box i32)

fn A ()
    label l
        do
            merge l (T)

fn B ()
    label l
        merge l (T)

fn C ()
    label l
        T;

C;
B;
# cannot access value of type (uniqueof <Box i32> 1000) because it has been moved
test-compiler-error
    A;
none

#11 under certain circumstances, an Rc copy can become corrupted 9 months ago

Ticket created by ~radgerayden on ~duangle/scopes

repro:

using import Array
using import Rc
using import enum

enum StorageKind
    Pointer : (Rc this-type)
    Function : (Rc (Array this-type))
    TypeReference : Symbol

    inline __copy (self)
        'apply self
            inline (T ...)
                # uncomment next line to see corruption
                # print ...
                T
                    va-map
                        inline (arg)
                            copy arg
                        ...

fn myfn (n)
    returning (uniqueof StorageKind -1)

    # ONLY HAPPENS WITH MATCH! NO SWITCH
    match n
    case 0
        let newST =
            copy
                this-function (n + 1)
        StorageKind.Pointer (Rc.wrap newST)
    case 1
        local args : (Array StorageKind)
        'append args
            copy
                this-function (n + 1)
        # doesn't happen without this return.
        return
            StorageKind.Function (Rc.wrap (deref args))
    default
        StorageKind.TypeReference 'unknown

myfn 0
none