<commit_before>precision highp float;

attribute vec4 p0, p1, p2, p3,
               p4, p5, p6, p7,
               p8, p9, pa, pb,
               pc, pd, pe, pf;

uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,
             loA, hiA, loB, hiB, loC, hiC, loD, hiD;

uniform vec2 resolution, viewBoxPosition, viewBoxSize, colorClamp;
uniform sampler2D mask, palette;
uniform float maskHeight;
uniform float isPickLayer;

varying vec4 fragColor;

precision highp float;

const int bitsPerByte = 8;

const vec4 zero = vec4(0.0, 0.0, 0.0, 0.0);
const vec4 unit = vec4(1.0, 1.0, 1.0, 1.0);

float val(mat4 p, mat4 v) {
    return dot(matrixCompMult(p, v) * unit, unit);
}

float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {
    float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);
    float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);
    return y1 * (1.0 - ratio) + y2 * ratio;
}

int iMod(int a, int b) {
    return a - b * (a / b);
}

bool vHide(vec4 p, vec4 lo, vec4 hi) {
    return (clamp(p, lo, hi) != p);
}

bool mShow(mat4 p, mat4 lo, mat4 hi) {
    return !(
        vHide(p[0], lo[0], hi[0]) ||
        vHide(p[1], lo[1], hi[1]) ||
        vHide(p[2], lo[2], hi[2]) ||
        vHide(p[3], lo[3], hi[3])
    );
}

bool withinBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {

    return mShow(A, loA, hiA) &&
           mShow(B, loB, hiB) &&
           mShow(C, loC, hiC) &&
           mShow(D, loD, hiD);
}

bool withinRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {
    mat4 pnts[4];
    pnts[0] = A;
    pnts[1] = B;
    pnts[2] = C;
    pnts[3] = D;

    bool result = true;
    int bitInByteStepper;
    float valY, valueY, scaleX;
    int hit, bitmask, valX;
    for(int i = 0; i < 4; ++i) {
        for(int j = 0; j < 4; ++j) {
            for(int k = 0; k < 4; ++k) {
                bitInByteStepper = iMod(j * 4 + k, 8);
                valX = i * 2 + j / 2;
                valY = pnts[i][j][k];
                valueY = valY * (maskHeight - 1.0) + 0.5;
                scaleX = (float(valX) + 0.5) / 8.0;
                hit = int(texture2D(mask, vec2(scaleX, (valueY + 0.5) / maskHeight))[3] * 255.0) / int(pow(2.0, float(bitInByteStepper)));
                result = result && iMod(hit, 2) > 0;
            }
        }
    }
    return result;
}<commit_msg>refactor parcoords - remove unused variables and optimize within raster mask logic<commit_after>precision highp float;

attribute vec4 p0, p1, p2, p3,
               p4, p5, p6, p7,
               p8, p9, pa, pb,
               pc, pd, pe, pf;

uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,
             loA, hiA, loB, hiB, loC, hiC, loD, hiD;

uniform vec2 resolution, viewBoxPosition, viewBoxSize, colorClamp;
uniform sampler2D mask, palette;
uniform float maskHeight;
uniform float isPickLayer;

varying vec4 fragColor;

precision highp float;

const vec4 zero = vec4(0.0, 0.0, 0.0, 0.0);
const vec4 unit = vec4(1.0, 1.0, 1.0, 1.0);

float val(mat4 p, mat4 v) {
    return dot(matrixCompMult(p, v) * unit, unit);
}

float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {
    float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);
    float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);
    return y1 * (1.0 - ratio) + y2 * ratio;
}

int iMod(int a, int b) {
    return a - b * (a / b);
}

bool vHide(vec4 p, vec4 lo, vec4 hi) {
    return (clamp(p, lo, hi) != p);
}

bool mShow(mat4 p, mat4 lo, mat4 hi) {
    return !(
        vHide(p[0], lo[0], hi[0]) ||
        vHide(p[1], lo[1], hi[1]) ||
        vHide(p[2], lo[2], hi[2]) ||
        vHide(p[3], lo[3], hi[3])
    );
}

bool withinBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {

    return mShow(A, loA, hiA) &&
           mShow(B, loB, hiB) &&
           mShow(C, loC, hiC) &&
           mShow(D, loD, hiD);
}

bool withinRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {
    mat4 pnts[4];
    pnts[0] = A;
    pnts[1] = B;
    pnts[2] = C;
    pnts[3] = D;

    bool result = true;
    float x, y;

    for(int i = 0; i < 4; ++i) {
        for(int j = 0; j < 4; ++j) {
            for(int k = 0; k < 4; ++k) {
                x = (float(i * 2 + j / 2) + 0.5) / 8.0;
                y = (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight;

                result = result &&
                    0 < iMod(
                        int(255.0 * texture2D(mask, vec2(x, y))[3]) /
                        int(pow(2.0, float(iMod(j * 4 + k, 8)))),
                        2
                    );
            }
        }
    }
    return result;
}
{'fraction_non_alphanumeric': 0.1640269038837058, 'fraction_numerical': 0.05445866782382296, 'mean_word_length': 1.9876863253402464, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4656503', 'n_tokens_mistral': 2034, 'n_tokens_neox': 1946, 'n_words': 545}