From unknown Sat Jun 21 12:20:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#11087 <11087@debbugs.gnu.org> To: bug#11087 <11087@debbugs.gnu.org> Subject: Status: vector limitation in compiling to bytecode Reply-To: bug#11087 <11087@debbugs.gnu.org> Date: Sat, 21 Jun 2025 19:20:40 +0000 retitle 11087 vector limitation in compiling to bytecode reassign 11087 guile submitter 11087 Ian Price severity 11087 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 24 16:41:27 2012 Received: (at submit) by debbugs.gnu.org; 24 Mar 2012 20:41:27 +0000 Received: from localhost ([127.0.0.1]:37231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBXm9-0000ys-Us for submit@debbugs.gnu.org; Sat, 24 Mar 2012 16:41:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42684) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBXlb-0000xo-IR for submit@debbugs.gnu.org; Sat, 24 Mar 2012 16:41:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBXHZ-0001SZ-VM for submit@debbugs.gnu.org; Sat, 24 Mar 2012 16:09:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:58745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBXHZ-0001SV-SJ for submit@debbugs.gnu.org; Sat, 24 Mar 2012 16:09:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBXHY-0000O6-AD for bug-guile@gnu.org; Sat, 24 Mar 2012 16:09:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBXHW-0001Ru-GH for bug-guile@gnu.org; Sat, 24 Mar 2012 16:09:47 -0400 Received: from plane.gmane.org ([80.91.229.3]:60676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBXHW-0001Rg-9q for bug-guile@gnu.org; Sat, 24 Mar 2012 16:09:46 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SBXHR-0002M6-BR for bug-guile@gnu.org; Sat, 24 Mar 2012 21:09:41 +0100 Received: from host86-182-154-121.range86-182.btcentralplus.com ([86.182.154.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Mar 2012 21:09:41 +0100 Received: from ianprice90 by host86-182-154-121.range86-182.btcentralplus.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Mar 2012 21:09:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-guile@gnu.org From: Ian Price Subject: vector limitation in compiling to bytecode Date: Sat, 24 Mar 2012 20:09:28 +0000 Lines: 33 Message-ID: <87wr69ahhj.fsf@Kagami.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: host86-182-154-121.range86-182.btcentralplus.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:V/PObkYA2VYcp0TAZBBkKnRzUM0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Hi guilers, Earlier today I had a compilation warning while running a script. ~/src/mine/algorithms-course $ guile -L . -s invsinarray.scm ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/ian/src/mine/algorithms-course/invsinarray.scm ;;; WARNING: compilation of /home/ian/src/mine/algorithms-course/invsinarray.scm failed: ;;; ERROR: In procedure bytevector-u8-set!: Value out of range: 390 It ran fine, but the compilation problem was that I had a vector constant containing 100000 values[0]. Now, the vector instruction in the vm expects the value to be less than 2^16, and when compiling this it performs splits the value into two by taking the value and modulus from dividing by 256. This leads to the instruction (vector 390 160), which further on down the line write-byte fails on. This limitation is documented, and somewhat reasonable, but on IRC mark weaver asked me to file a bug anyway, since he thinks the assembler should have a fall back plan. [0] as you can guess from the names, it was data provided for an online algorithms class I'm taking. I did the lazy thing and just wrapped the file in #(...). I've since changed it to actually read the vector from the file. -- Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 05 17:06:48 2012 Received: (at 11087-done) by debbugs.gnu.org; 5 Jul 2012 21:06:48 +0000 Received: from localhost ([127.0.0.1]:51025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmtGB-0003Ob-PM for submit@debbugs.gnu.org; Thu, 05 Jul 2012 17:06:48 -0400 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:62773 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmtGA-0003OU-4I for 11087-done@debbugs.gnu.org; Thu, 05 Jul 2012 17:06:46 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id EE645B62E; Thu, 5 Jul 2012 17:01:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=1zDawQ8GSHTxAkWjmgt73O2hepI=; b=rjV70p d4xXBr1RNxpp9S8Uf0BgnKjCX39h98KDxiiHNgjSBUhPplLjhz628vJdG0CSMbru e6/Y9wiuTTy5l+l3ENmkMUneaxekTvpE57H1/s6cSQeN9BwtAyVOYEpG2GgO46ca PVh3OvhSYaJ/lEKQ1zaZLhAwpVu9FWUWsbAN0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=xwkVFJqJeE3zr0XhikytnZRAG/UjPbq1 ivbPG4y4zIYcNYZz6piO+0QKVirRqdneiTjNOl1hA+mjMxpxuV3ywRdSrbdM8LEA gmrkPqFrZkOfkOEBPFOsM2s5a0jo058RA2BbbXXoFYtucV7FMkcv7TlgAHMB009c eDrsPbDi2CY= Received: from b-pb-sasl-sd. (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id E6A5AB62D; Thu, 5 Jul 2012 17:01:50 -0400 (EDT) Received: from badger (unknown [89.131.176.233]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 51501B62C; Thu, 5 Jul 2012 17:01:50 -0400 (EDT) From: Andy Wingo To: Ian Price Subject: Re: bug#11087: vector limitation in compiling to bytecode References: <87wr69ahhj.fsf@Kagami.home> Date: Thu, 05 Jul 2012 23:01:42 +0200 In-Reply-To: <87wr69ahhj.fsf@Kagami.home> (Ian Price's message of "Sat, 24 Mar 2012 20:09:28 +0000") Message-ID: <87hatl53d5.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: A40AF8D8-C6E4-11E1-852E-FA6787E41631-02397024!b-pb-sasl-sd.pobox.com X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11087-done Cc: 11087-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On Sat 24 Mar 2012 21:09, Ian Price writes: > ;;; ERROR: In procedure bytevector-u8-set!: Value out of range: 390 > vector constant containing 100000 values > > This limitation is documented, and somewhat reasonable, but on IRC mark > weaver asked me to file a bug anyway, since he thinks the assembler > should have a fall back plan. I agree with Mark. For what it's worth, if the vector is really constant (e.g. just composed of immediates), the RTL VM will emit the whole thing statically. Otherwise it will emit code to allocate a vector of the right size at init time, initializing its elements with individual instructions. This latter strategy is probably the right thing to do with the Guile 2.0 VM. In the mean time, I added a check for the vector-length to glil/compile-assembly.scm. If the vector is too big, it hits the array case, which has a 24-bit range. It seems to hit some other problem after that, but I gave it the ole college try, right? Cheers, Andy -- http://wingolog.org/ From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 05 17:09:42 2012 Received: (at 11087) by debbugs.gnu.org; 5 Jul 2012 21:09:42 +0000 Received: from localhost ([127.0.0.1]:51038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmtIz-0003TN-GX for submit@debbugs.gnu.org; Thu, 05 Jul 2012 17:09:41 -0400 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:65174 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmtIx-0003TG-Fd for 11087@debbugs.gnu.org; Thu, 05 Jul 2012 17:09:40 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 0E249B646 for <11087@debbugs.gnu.org>; Thu, 5 Jul 2012 17:04:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=PkoaGVY3Qedbf3w5F0UOULqDdMs=; b=lG6H98 ktOo77y5kSj7ZOXZHEV6zH+YnMupsoJS8T/kWYUPlgClAKW+TnZT5mS7mI8xiluR DJxTXXlo4dOsqIlVcANPdzf0chFqy6eg3ajreYAe7+sQjasLC4KkPQ0dcr4R0kmp mJdzE+PnVXNnWeHQBf/+xIucExUoe2NPrKJcQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=LqiWD9NGYWZVHE1aWmqFtiD2S2mmqsLv HFkicZFMAk3CE4qcGhHYUV+Ake+/G+olzi6ypd0tvGuWLag0uJuRYVz9fIlyEcR1 J8nXgPd0YL8hPIaaEpX8Afz8G+BTvjrmqOnHqHZxGXoQZzJ4k/vMX7HteTePoEtk CEGPmiW68b4= Received: from b-pb-sasl-sd. (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 07354B645 for <11087@debbugs.gnu.org>; Thu, 5 Jul 2012 17:04:45 -0400 (EDT) Received: from badger (unknown [89.131.176.233]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 5AFD9B644 for <11087@debbugs.gnu.org>; Thu, 5 Jul 2012 17:04:44 -0400 (EDT) From: Andy Wingo To: 11087@debbugs.gnu.org Subject: Re: bug#11087: vector limitation in compiling to bytecode References: <87wr69ahhj.fsf@Kagami.home> <87hatl53d5.fsf@pobox.com> Date: Thu, 05 Jul 2012 23:04:41 +0200 In-Reply-To: <87hatl53d5.fsf@pobox.com> (Andy Wingo's message of "Thu, 05 Jul 2012 23:01:42 +0200") Message-ID: <87d3495386.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 0BC70CD2-C6E5-11E1-98F5-FA6787E41631-02397024!b-pb-sasl-sd.pobox.com X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11087 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On Thu 05 Jul 2012 23:01, Andy Wingo writes: > It seems to hit some other problem after that, but I gave it the ole > college try, right? FWIW the problem is that building an array first pushes all the elements on the stack. It can be fixed by setting a larger stack size. The RTL branch will also fix this. Andy -- http://wingolog.org/ From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 06 02:57:25 2012 Received: (at 11087) by debbugs.gnu.org; 6 Jul 2012 06:57:25 +0000 Received: from localhost ([127.0.0.1]:51355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sn2Ti-00030r-Va for submit@debbugs.gnu.org; Fri, 06 Jul 2012 02:57:24 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:55486) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sn2Tf-00030j-Nj for 11087@debbugs.gnu.org; Fri, 06 Jul 2012 02:57:21 -0400 Received: by were53 with SMTP id e53so114536wer.3 for <11087@debbugs.gnu.org>; Thu, 05 Jul 2012 23:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=W3ZvqqpaECaX4Rukj6XTbudz99zRm5IxZKRy9FYFe4I=; b=old7LaMIrIXUOKkZ3HE993iBEo+q+2biPr2HXzj6a/8wyvG0GzlCmuK8SHiasUeOsB B33YpvQ2GzJ5rXEqz9MJ1vyrerR8Nps6yFpOAFh8Ej6M278zyXQKiR/Z2qAm+LzAP6Wx vuDLMTCTyNxI4NhTtoR2NzI5Kl0zZWu4Rl6M3Rg8bU7uOF4g5M3EXI0aSajPWihnXbzV fMgZgFrgjno5or7zYidmeX2ZIPGdH6fFJoASQLV3LNo3NTlDhK6F+XCSWRidPs+TJ7PI A5yCtZ6dLWJDA5+CVTHNYINd81Q03WrtHPNlv6DDa2McYeP7pSddpUYN6JuqHrEmEtTd qOXw== Received: by 10.180.19.169 with SMTP id g9mr5192118wie.9.1341557542030; Thu, 05 Jul 2012 23:52:22 -0700 (PDT) Received: from Kagami.home (host86-179-77-224.range86-179.btcentralplus.com. [86.179.77.224]) by mx.google.com with ESMTPS id y2sm4169905wix.7.2012.07.05.23.52.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Jul 2012 23:52:21 -0700 (PDT) From: Ian Price To: 11087@debbugs.gnu.org Subject: Re: bug#11087: vector limitation in compiling to bytecode References: <87wr69ahhj.fsf@Kagami.home> <87hatl53d5.fsf@pobox.com> Date: Fri, 06 Jul 2012 07:52:15 +0100 In-Reply-To: <87hatl53d5.fsf@pobox.com> (Andy Wingo's message of "Thu, 05 Jul 2012 23:01:42 +0200") Message-ID: <8762a1mleo.fsf@Kagami.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 11087 Cc: wingo@pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) Andy Wingo writes: > On Sat 24 Mar 2012 21:09, Ian Price writes: > >> ;;; ERROR: In procedure bytevector-u8-set!: Value out of range: 390 >> vector constant containing 100000 values >> >> This limitation is documented, and somewhat reasonable, but on IRC mark >> weaver asked me to file a bug anyway, since he thinks the assembler >> should have a fall back plan. > > I agree with Mark. > > For what it's worth, if the vector is really constant (e.g. just > composed of immediates), the RTL VM will emit the whole thing > statically. Otherwise it will emit code to allocate a vector > of the right size at init time, initializing its elements with > individual instructions. This latter strategy is probably the right > thing to do with the Guile 2.0 VM. In my case, it was completely static. I had generated the vector from another file, of existing data. It's good to hear this will work in the future rtl based guile. Thanks -- Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" From unknown Sat Jun 21 12:20:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 03 Aug 2012 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator