<commit_before>import QtQuick 2.3
import radiance 1.0

GraphicalDisplay {
    implicitWidth: 500;
    implicitHeight: 100;

    fragmentShader: "
        // Alpha-compsite two colors, putting one on top of the other
        vec4 composite(vec4 under, vec4 over) {
            float a_out = 1. - (1. - over.a) * (1. - under.a);
            return clamp(vec4((over.rgb * over.a  + under.rgb * under.a * (1. - over.a)) / a_out, a_out), vec4(0.), vec4(1.));
        }

        uniform sampler1D iSpectrum;
        uniform vec2 iResolution;

        void main(void) {
            vec2 uv = gl_FragCoord.xy / iResolution;
            float g = uv.y * 0.5 + 0.1;
            float w = 4.;

            gl_FragColor = vec4(0.);

            float freq = (uv.x - 0.5) + 0.5;
            float mag = (0.5 - uv.y) + 0.5;
            float d = (texture1D(iSpectrum, freq).r - mag) * 90.;
            float a = smoothstep(0., 1., d);
            float gb = 0.5 * clamp(0., 1., d / 30.);
            gl_FragColor = composite(gl_FragColor, vec4(1., gb, gb, a));
            gl_FragColor.rgb *= gl_FragColor.a;
        }"
}<commit_msg>fix a bug in spectrum<commit_after>import QtQuick 2.3
import radiance 1.0

GraphicalDisplay {
    implicitWidth: 500;
    implicitHeight: 100;

    fragmentShader: "
        // Alpha-compsite two colors, putting one on top of the other
        vec4 composite(vec4 under, vec4 over) {
            float a_out = 1. - (1. - over.a) * (1. - under.a);
            return clamp(vec4((over.rgb * over.a  + under.rgb * under.a * (1. - over.a)) / a_out, a_out), vec4(0.), vec4(1.));
        }

        uniform sampler1D iSpectrum;
        uniform vec2 iResolution;

        void main(void) {
            vec2 uv = gl_FragCoord.xy / iResolution;
            float g = uv.y * 0.5 + 0.1;
            float w = 4.;

            gl_FragColor = vec4(0.);

            float freq = (uv.x - 0.5) + 0.5;
            float mag = (0.5 - uv.y) + 0.5;
            float d = (texture1D(iSpectrum, freq).r - mag) * 90.;
            float a = smoothstep(0., 1., d);
            float gb = 0.5 * clamp(d / 30., 0., 1.);
            gl_FragColor = composite(gl_FragColor, vec4(1., gb, gb, a));
            gl_FragColor.rgb *= gl_FragColor.a;
        }"
}
{'fraction_non_alphanumeric': 0.14069456812110417, 'fraction_numerical': 0.04719501335707925, 'mean_word_length': 1.6280701754385964, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1849412', 'n_tokens_mistral': 870, 'n_tokens_neox': 797, 'n_words': 210}