Diff of the two buildlogs: -- --- b1/build.log 2024-11-17 19:40:41.437568546 +0000 +++ b2/build.log 2024-11-17 19:45:23.940719172 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sun Nov 17 07:30:39 -12 2024 -I: pbuilder-time-stamp: 1731871839 +I: Current time: Mon Nov 18 09:41:22 +14 2024 +I: pbuilder-time-stamp: 1731872482 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -26,52 +26,84 @@ dpkg-source: info: unpacking python-moderngl_5.12.0-1.debian.tar.xz I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/31471/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/29812/tmp/hooks/D01_modify_environment starting +debug: Running on virt64b. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Nov 17 19:41 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/29812/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/29812/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='trixie' - HOME='/root' - HOST_ARCH='armhf' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="32" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.32(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4 ' + DIRSTACK=() + DISTRIBUTION=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='7703631fbee2473dbcb895259db69e28' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='31471' - PS1='# ' - PS2='> ' + INVOCATION_ID=67f3a2708dc34e3199c4f0e9247eaab9 + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=29812 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.AdbHVAEy/pbuilderrc_gIqi --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.AdbHVAEy/b1 --logfile b1/build.log python-moderngl_5.12.0-1.dsc' - SUDO_GID='113' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.AdbHVAEy/pbuilderrc_oYOh --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.AdbHVAEy/b2 --logfile b2/build.log python-moderngl_5.12.0-1.dsc' + SUDO_GID=113 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux wbq0 6.1.0-27-armmp #1 SMP Debian 6.1.115-1 (2024-11-01) armv7l GNU/Linux + Linux i-capture-the-hostname 6.1.0-27-arm64 #1 SMP Debian 6.1.115-1 (2024-11-01) aarch64 GNU/Linux I: ls -l /bin lrwxrwxrwx 1 root root 7 Aug 4 21:30 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/31471/tmp/hooks/D02_print_environment finished +I: user script /srv/workspace/pbuilder/29812/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -348,7 +380,7 @@ Get: 203 http://deb.debian.org/debian trixie/main armhf xkb-data all 2.42-1 [790 kB] Get: 204 http://deb.debian.org/debian trixie/main armhf xserver-common all 2:21.1.14-1 [2397 kB] Get: 205 http://deb.debian.org/debian trixie/main armhf xvfb armhf 2:21.1.14-1 [3033 kB] -Fetched 125 MB in 13s (9914 kB/s) +Fetched 125 MB in 3s (49.6 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package fonts-lato. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19691 files and directories currently installed.) @@ -1017,8 +1049,8 @@ Setting up tzdata (2024b-3) ... Current default time zone: 'Etc/UTC' -Local time is now: Sun Nov 17 19:33:24 UTC 2024. -Universal Time is now: Sun Nov 17 19:33:24 UTC 2024. +Local time is now: Sun Nov 17 19:42:32 UTC 2024. +Universal Time is now: Sun Nov 17 19:42:32 UTC 2024. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up libxcb-present0:armhf (1.17.0-2+b1) ... @@ -1213,7 +1245,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/python-moderngl-5.12.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../python-moderngl_5.12.0-1_source.changes +I: user script /srv/workspace/pbuilder/29812/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/29812/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/python-moderngl-5.12.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../python-moderngl_5.12.0-1_source.changes dpkg-buildpackage: info: source package python-moderngl dpkg-buildpackage: info: source version 5.12.0-1 dpkg-buildpackage: info: source distribution unstable @@ -1266,17 +1302,17 @@ running install_lib creating build/bdist.linux-armv7l creating build/bdist.linux-armv7l/wheel -creating build/bdist.linux-armv7l/wheel/moderngl-stubs -copying build/lib.linux-armv7l-cpython-312/moderngl-stubs/__init__.pyi -> build/bdist.linux-armv7l/wheel/./moderngl-stubs creating build/bdist.linux-armv7l/wheel/moderngl copying build/lib.linux-armv7l-cpython-312/moderngl/mgl.cpython-312-arm-linux-gnueabihf.so -> build/bdist.linux-armv7l/wheel/./moderngl copying build/lib.linux-armv7l-cpython-312/moderngl/__init__.py -> build/bdist.linux-armv7l/wheel/./moderngl copying build/lib.linux-armv7l-cpython-312/_moderngl.py -> build/bdist.linux-armv7l/wheel/. +creating build/bdist.linux-armv7l/wheel/moderngl-stubs +copying build/lib.linux-armv7l-cpython-312/moderngl-stubs/__init__.pyi -> build/bdist.linux-armv7l/wheel/./moderngl-stubs running install_egg_info Copying moderngl.egg-info to build/bdist.linux-armv7l/wheel/./moderngl-5.12.0.egg-info running install_scripts creating build/bdist.linux-armv7l/wheel/moderngl-5.12.0.dist-info/WHEEL -creating '/build/reproducible-path/python-moderngl-5.12.0/.pybuild/cpython3_3.12_moderngl/.tmp-jn5fht9l/moderngl-5.12.0-cp312-cp312-linux_armv7l.whl' and adding 'build/bdist.linux-armv7l/wheel' to it +creating '/build/reproducible-path/python-moderngl-5.12.0/.pybuild/cpython3_3.12_moderngl/.tmp-pezpy1x1/moderngl-5.12.0-cp312-cp312-linux_armv7l.whl' and adding 'build/bdist.linux-armv7l/wheel' to it adding '_moderngl.py' adding 'moderngl/__init__.py' adding 'moderngl/mgl.cpython-312-arm-linux-gnueabihf.so' @@ -1450,9 +1486,9 @@ tests/test_compute_shader.py ........ [ 13%] tests/test_compute_shader_uniform.py . [ 13%] tests/test_context.py ............ [ 17%] -tests/test_cull_face.py . [ 17%] +tests/test_cull_face.py F [ 17%] tests/test_debug_scopes.py ..... [ 18%] -tests/test_depth_samplers.py ... [ 19%] +tests/test_depth_samplers.py FFF [ 19%] tests/test_framebuffer.py ..... [ 21%] tests/test_framebuffer_clear.py . [ 21%] tests/test_framebuffer_half_float.py . [ 21%] @@ -1478,7 +1514,7 @@ tests/test_simple_texture.py ...................... [ 55%] tests/test_simple_texture_3d.py ................. [ 59%] tests/test_spirv_parsing.py . [ 60%] -tests/test_texture.py .......... [ 62%] +tests/test_texture.py .F........ [ 62%] tests/test_texture_array.py .. [ 63%] tests/test_texture_cube.py ..... [ 64%] tests/test_texture_external.py . [ 65%] @@ -1500,7 +1536,422 @@ ....... [ 99%] tests/test_viewports.py . [100%] -================= 359 passed, 1 deselected in 65.38s (0:01:05) ================= +=================================== FAILURES =================================== +________________________________ test_cull_face ________________________________ + +ctx = +prog_render_depth_pass = +vbo_triangle = +fbo_with_rasterised_triangle = ._build_fbo_with_rasterised_triangle at 0xf5e69938> +np_triangle_rasterised = ._build_np_triangle_rastised at 0xf5e69f78> + + def test_cull_face(ctx, + prog_render_depth_pass, + vbo_triangle, + fbo_with_rasterised_triangle, + np_triangle_rasterised): + + size = (16,) * 2 + + ctx.enable(mgl.DEPTH_TEST) + ctx.enable(mgl.CULL_FACE) + + def _do_test_cull_face(cull_face: str, expected_results: np.array): + ctx.cull_face = cull_face + fbo_depth, tex_depth = fbo_with_rasterised_triangle(prog_render_depth_pass, size) + depth_from_dbo = np.frombuffer(tex_depth.read(), dtype=np.dtype('f4')).reshape(size[::-1]) + np.testing.assert_array_almost_equal(depth_from_dbo, expected_results) + + ############################################################################ + # EXPECTED DATAS# + # It should have 0.5's where the triangle lies. + ############################################################################ + np_triangle_raster = np_triangle_rasterised(size) + ############################################################################ + # cull face is set to back, only one 'front' triangle in the scene => no culling +> _do_test_cull_face('back', np_triangle_raster) + +tests/test_cull_face.py:92: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/test_cull_face.py:83: in _do_test_cull_face + np.testing.assert_array_almost_equal(depth_from_dbo, expected_results) +/usr/lib/python3.12/contextlib.py:81: in inner + return func(*args, **kwds) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +args = (.compare at 0xf466c078>, array([[5.960465e-08, 5.960465e-08, 5.960465e-08... 1. , 1. , 1. ], + [1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , + 1. , 1. , 1. ]])) +kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True} + + @wraps(func) + def inner(*args, **kwds): + with self._recreate_cm(): +> return func(*args, **kwds) +E AssertionError: +E Arrays are not almost equal to 6 decimals +E +E Mismatched elements: 120 / 256 (46.9%) +E Max absolute difference: 0.49999994 +E Max relative difference: 0.99999988 +E x: array([[5.960465e-08, 5.960465e-08, 5.960465e-08, 5.960465e-08, +E 5.960465e-08, 5.960465e-08, 5.960465e-08, 5.960465e-08, +E 5.960465e-08, 5.960465e-08, 5.960465e-08, 5.960465e-08,... +E y: array([[0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, +E 0.5, 0.5, 1. ], +E [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,... + +/usr/lib/python3.12/contextlib.py:81: AssertionError +______________________________ test_depth_sampler ______________________________ + +ctx = +prog_render_depth_pass = +prog_draw_depth = +vbo_triangle = +vbo_quad = +fbo_with_rasterized_triangle = ._build_fbo_with_rasterized_triangle at 0xf44f0078> +np_triangle_rasterized = ._build_np_triangle_rasterized at 0xf44f0118> + + def test_depth_sampler( + ctx, + prog_render_depth_pass, + prog_draw_depth, + vbo_triangle, + vbo_quad, + fbo_with_rasterized_triangle, + np_triangle_rasterized, + ): + ctx.enable(mgl.DEPTH_TEST) + + size = (16,) * 2 + fbo_depth, tex_depth = fbo_with_rasterized_triangle(prog_render_depth_pass, size) + depth_from_dbo = np.frombuffer(tex_depth.read(), dtype=np.dtype('f4')).reshape(size[::-1]) + + ############################################################################ + # EXPECTED DATAS + # It should have 0.5's where the triangle lies. + ############################################################################ + np_triangle_raster = np_triangle_rasterized(size) + + depth_tex_filter = (moderngl.NEAREST, moderngl.NEAREST) + compare_func = '' + + def _do_test(): + # some stuff should be 1s and 0.5 where the triangle lies. + np.testing.assert_array_almost_equal(depth_from_dbo, np_triangle_raster) + + fbo_draw_depth = ctx.framebuffer(color_attachments=[ctx.renderbuffer(size, components=1, dtype='f4')]) + fbo_draw_depth.use() + + tex_depth.use(location=0) + + # vertex array object of (fullscreen) quad with render depth prog + vao_quad = ctx.simple_vertex_array(prog_draw_depth, vbo_quad, 'in_vert') + vao_quad.render(moderngl.TRIANGLE_STRIP) + + data = np.frombuffer(fbo_draw_depth.read(components=1, dtype='f4'), dtype=np.dtype('f4')).reshape(size[::-1]) + np.testing.assert_array_almost_equal(data, np_triangle_raster) + + def _with_sampler(): + # from: https://github.com/Contraz/demosys-py/blob/master/demosys/opengl/texture.py + depth_sampler = ctx.sampler(filter=depth_tex_filter, compare_func=compare_func) # disable depth func + depth_sampler.use(location=0) + _do_test() + + def _with_texture_parameters(): + tex_depth.filter = depth_tex_filter + tex_depth.compare_func = compare_func + _do_test() + +> _with_sampler() + +tests/test_depth_samplers.py:216: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/test_depth_samplers.py:209: in _with_sampler + _do_test() +tests/test_depth_samplers.py:191: in _do_test + np.testing.assert_array_almost_equal(depth_from_dbo, np_triangle_raster) +/usr/lib/python3.12/contextlib.py:81: in inner + return func(*args, **kwds) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +args = (.compare at 0xf44f0208>, array([[5.960465e-08, 5.960465e-08, 5.960465e-08... 1. , 1. , 1. ], + [1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , + 1. , 1. , 1. ]])) +kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True} + + @wraps(func) + def inner(*args, **kwds): + with self._recreate_cm(): +> return func(*args, **kwds) +E AssertionError: +E Arrays are not almost equal to 6 decimals +E +E Mismatched elements: 120 / 256 (46.9%) +E Max absolute difference: 0.49999994 +E Max relative difference: 0.99999988 +E x: array([[5.960465e-08, 5.960465e-08, 5.960465e-08, 5.960465e-08, +E 5.960465e-08, 5.960465e-08, 5.960465e-08, 5.960465e-08, +E 5.960465e-08, 5.960465e-08, 5.960465e-08, 5.960465e-08,... +E y: array([[0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, +E 0.5, 0.5, 1. ], +E [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,... + +/usr/lib/python3.12/contextlib.py:81: AssertionError +_____________________________ test_sampler_shadow ______________________________ + +ctx = +prog_render_depth_pass = +prog_shadow_test = +vbo_triangle = +vbo_quad = +fbo_with_rasterized_triangle = ._build_fbo_with_rasterized_triangle at 0xf44f0848> + + def test_sampler_shadow( + ctx, + prog_render_depth_pass, prog_shadow_test, + vbo_triangle, vbo_quad, + fbo_with_rasterized_triangle, + ): + ctx.enable(mgl.DEPTH_TEST) + + size = (3,) * 2 + fbo_depth, tex_depth = fbo_with_rasterized_triangle(prog_render_depth_pass, size) + + ############################################################################ + # EXPECTED DATAS # + # It should have 1's where the triangle lies. # + ############################################################################ + texel_shadowed = 1 + np_triangle_raster_visibility = np.array( + [ + [texel_shadowed] * (size[0] - (j + 1)) + [1 - texel_shadowed] * (j + 1) + for j in range(size[1]) + ] + ) + ############################################################################ + + # No offset - fetch the center pixel (NEAREST) + prog_shadow_test['u_shadow_coord_offset'].value = (0,) * 2 + + depth_tex_filter = (moderngl.NEAREST, moderngl.NEAREST) + compare_func = '>=' + + def _do_test(): + fbo_draw_depth = ctx.framebuffer(color_attachments=[ctx.renderbuffer(size, components=1, dtype='f4')]) + fbo_draw_depth.use() + + tex_depth.use(location=0) + + # https://www.khronos.org/opengl/wiki/Sampler_(GLSL)#Shadow_samplers + vao_fs_shadow = ctx.simple_vertex_array(prog_shadow_test, vbo_quad, 'in_vert') + vao_fs_shadow.render(moderngl.TRIANGLE_STRIP) + + data = np.frombuffer(fbo_draw_depth.read(components=1, dtype='f4'), dtype=np.dtype('f4')).reshape(size[::-1]) + np.testing.assert_array_almost_equal(data, np_triangle_raster_visibility) + + def _with_sampler(): + # https://github.com/Contraz/demosys-py/blob/01f285cd3a132012e14a51bf0ae9d7aa5a489b55/demosys/opengl/texture.py#L151 + shadow_sampler = ctx.sampler(filter=depth_tex_filter, compare_func=compare_func) # enable depth func + shadow_sampler.use(location=0) + _do_test() + shadow_sampler.clear(location=0) + + def _with_texture_parameters(): + tex_depth.filter = depth_tex_filter + tex_depth.compare_func = compare_func + _do_test() + +> _with_sampler() + +tests/test_depth_samplers.py:275: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/test_depth_samplers.py:267: in _with_sampler + _do_test() +tests/test_depth_samplers.py:261: in _do_test + np.testing.assert_array_almost_equal(data, np_triangle_raster_visibility) +/usr/lib/python3.12/contextlib.py:81: in inner + return func(*args, **kwds) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +args = (.compare at 0xf44f0b18>, array([[1., 1., 1.], + [1., 1., 1.], + [1., 1., 1.]], dtype=float32), array([[1, 1, 0], + [1, 0, 0], + [0, 0, 0]])) +kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True} + + @wraps(func) + def inner(*args, **kwds): + with self._recreate_cm(): +> return func(*args, **kwds) +E AssertionError: +E Arrays are not almost equal to 6 decimals +E +E Mismatched elements: 6 / 9 (66.7%) +E Max absolute difference: 1. +E Max relative difference: 0. +E x: array([[1., 1., 1.], +E [1., 1., 1.], +E [1., 1., 1.]], dtype=float32) +E y: array([[1, 1, 0], +E [1, 0, 0], +E [0, 0, 0]]) + +/usr/lib/python3.12/contextlib.py:81: AssertionError +_______________ test_sampler_shadow_with_bilinear_interpolation ________________ + +ctx = +prog_render_depth_pass = +prog_shadow_test = +vbo_triangle = +vbo_quad = +fbo_with_rasterized_triangle = ._build_fbo_with_rasterized_triangle at 0xf44f0a78> + + def test_sampler_shadow_with_bilinear_interpolation( + ctx, + prog_render_depth_pass, prog_shadow_test, + vbo_triangle, vbo_quad, + fbo_with_rasterized_triangle + ): + ctx.enable(mgl.DEPTH_TEST) + size = (7,) * 2 + + fbo_depth, tex_depth = fbo_with_rasterized_triangle(prog_render_depth_pass, size) + + ############################################################################ + # EXPECTED DATAS # + ############################################################################ + # Box filter (2x2) on triangle visibility rasterization + # is similar to bilinear interpolation with samplerShadow + # https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.uniform_filter.html#scipy.ndimage.uniform_filter + np_triangle_raster_visibility = np.array( + [ + [1.0] * (size[0] - (j + 1)) + [0.0] * (j + 1) + for j in range(size[1]) + ] + ) + box_filter_on_triangle_raster_visibility = ndimage.uniform_filter( + np_triangle_raster_visibility, + size=2, mode='constant', cval=0, origin=-1) + ############################################################################ + + half_pixel_size = (1.0 / size[0] * 0.5, 1.0 / size[1] * 0.5) + prog_shadow_test['u_shadow_coord_offset'].value = tuple(half_pixel_size) + + def _do_test(): + fbo_draw_depth = ctx.framebuffer( + color_attachments=[ctx.renderbuffer(size, + components=1, dtype='f4')]) + fbo_draw_depth.use() + tex_depth.use(location=0) + + # https://www.khronos.org/opengl/wiki/Sampler_(GLSL)#Shadow_samplers + vao_fs_shadow = ctx.simple_vertex_array(prog_shadow_test, vbo_quad, + 'in_vert') + vao_fs_shadow.render(moderngl.TRIANGLE_STRIP) + + # + data = np.frombuffer(fbo_draw_depth.read(components=1, dtype='f4'), + dtype=np.dtype('f4')).reshape(size[::-1]) + np.testing.assert_array_almost_equal( + data, box_filter_on_triangle_raster_visibility) + + depth_tex_filter = (moderngl.LINEAR, moderngl.LINEAR) + compare_func = '>=' + + def _with_sampler(): + # https://github.com/Contraz/demosys-py/blob/01f285cd3a132012e14a51bf0ae9d7aa5a489b55/demosys/opengl/texture.py#L151 + shadow_sampler = ctx.sampler( + filter=depth_tex_filter, + compare_func=compare_func, # enable depth func + # from context.py: + # border_color (tuple): The (r, g, b, a) color for the texture border. + # When this value is set the ``repeat_`` values are overridden + # setting the texture wrap to return the border color when outside ``[0, 1]`` range. + # border_color=(0, 0, 0, 0), # seems not to work well ... + repeat_x=False, repeat_y=False, + ) + shadow_sampler.use(location=0) + _do_test() + shadow_sampler.clear(location=0) + + def _with_texture_parameters(): + tex_depth.filter = depth_tex_filter + tex_depth.repeat_x = False + tex_depth.repeat_y = False + tex_depth.compare_func = compare_func + _do_test() + +> _with_sampler() + +tests/test_depth_samplers.py:354: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/test_depth_samplers.py:344: in _with_sampler + _do_test() +tests/test_depth_samplers.py:325: in _do_test + np.testing.assert_array_almost_equal( +/usr/lib/python3.12/contextlib.py:81: in inner + return func(*args, **kwds) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +args = (.compare at 0xf44f0e88>, array([[1., 1., 1., 1., 1., 1., 0.], + [1.,... , 0. , 0. ], + [0.25, 0. , 0. , 0. , 0. , 0. , 0. ], + [0. , 0. , 0. , 0. , 0. , 0. , 0. ]])) +kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True} + + @wraps(func) + def inner(*args, **kwds): + with self._recreate_cm(): +> return func(*args, **kwds) +E AssertionError: +E Arrays are not almost equal to 6 decimals +E +E Mismatched elements: 11 / 49 (22.4%) +E Max absolute difference: 0.75 +E Max relative difference: 3. +E x: array([[1., 1., 1., 1., 1., 1., 0.], +E [1., 1., 1., 1., 1., 0., 0.], +E [1., 1., 1., 1., 0., 0., 0.],... +E y: array([[1. , 1. , 1. , 1. , 0.75, 0.25, 0. ], +E [1. , 1. , 1. , 0.75, 0.25, 0. , 0. ], +E [1. , 1. , 0.75, 0.25, 0. , 0. , 0. ],... + +/usr/lib/python3.12/contextlib.py:81: AssertionError +____________________________________ test_1 ____________________________________ + +ctx = +vao = + + def test_1(ctx, vao): + assert vao.mode == moderngl.TRIANGLES + fbo = ctx.framebuffer(ctx.renderbuffer((16, 16))) + pixels = struct.pack('16B', 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, 0, 0, 0, 255) + texture = ctx.texture((2, 2), 4, pixels) + + fbo.use() + texture.use() + + texture.filter = (moderngl.LINEAR, moderngl.LINEAR) + vao.render(moderngl.TRIANGLE_STRIP) + + r, g, b = struct.unpack('3B', fbo.read((8, 8, 1, 1))) +> assert (abs(r - 49) < 8 and abs(g - 63) < 8 and abs(b - 63) < 8) +E assert (14 < 8) +E + where 14 = abs((63 - 49)) + +tests/test_texture.py:70: AssertionError +=========================== short test summary info ============================ +FAILED tests/test_cull_face.py::test_cull_face - AssertionError: +FAILED tests/test_depth_samplers.py::test_depth_sampler - AssertionError: +FAILED tests/test_depth_samplers.py::test_sampler_shadow - AssertionError: +FAILED tests/test_depth_samplers.py::test_sampler_shadow_with_bilinear_interpolation +FAILED tests/test_texture.py::test_1 - assert (14 < 8) +================= 5 failed, 354 passed, 1 deselected in 35.07s ================= +E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /build/reproducible-path/python-moderngl-5.12.0/.pybuild/cpython3_3.12_moderngl/build; xvfb-run --auto-servernum --server-num=20 -s "-screen 0 1024x768x24 -ac +extension GLX -noreset" {interpreter} -m pytest -k "not (test_local or test_documentation or test_module_integrity)" +dh_auto_test: error: pybuild --test -i python{version} -p 3.12 returned exit code 13 +make[1]: [debian/rules:14: override_dh_auto_test] Error 25 (ignored) make[1]: Leaving directory '/build/reproducible-path/python-moderngl-5.12.0' create-stamp debian/debhelper-build-stamp dh_testroot -O--buildsystem=pybuild @@ -1510,9 +1961,9 @@ dh_installdocs -O--buildsystem=pybuild dh_installdocs: warning: Cannot auto-detect main package for python-moderngl-doc. If the default is wrong, please use --doc-main-package dh_sphinxdoc -O--buildsystem=pybuild -dh_sphinxdoc: warning: ignoring unknown JavaScript code: debian/python-moderngl-doc/usr/share/doc/python-moderngl-doc/html/_static/clipboard.min.js -dh_sphinxdoc: warning: ignoring unknown JavaScript code: debian/python-moderngl-doc/usr/share/doc/python-moderngl-doc/html/_static/copybutton.js dh_sphinxdoc: warning: ignoring unknown JavaScript code: debian/python-moderngl-doc/usr/share/doc/python-moderngl-doc/html/_static/copybutton_funcs.js +dh_sphinxdoc: warning: ignoring unknown JavaScript code: debian/python-moderngl-doc/usr/share/doc/python-moderngl-doc/html/_static/copybutton.js +dh_sphinxdoc: warning: ignoring unknown JavaScript code: debian/python-moderngl-doc/usr/share/doc/python-moderngl-doc/html/_static/clipboard.min.js dh_installchangelogs -O--buildsystem=pybuild dh_python3 -O--buildsystem=pybuild dh_installsystemduser -O--buildsystem=pybuild @@ -1545,12 +1996,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: including full source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/29812/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/29812/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/31471 and its subdirectories -I: Current time: Sun Nov 17 07:40:36 -12 2024 -I: pbuilder-time-stamp: 1731872436 +I: removing directory /srv/workspace/pbuilder/29812 and its subdirectories +I: Current time: Mon Nov 18 09:45:18 +14 2024 +I: pbuilder-time-stamp: 1731872718