diff --git a/analysis/statistics/16d7754fb4a4cd69a1028da671ef704574b4e9d4.txt b/analysis/statistics/16d7754fb4a4cd69a1028da671ef704574b4e9d4.txt index 1790b98b5..49981dbb1 100644 --- a/analysis/statistics/16d7754fb4a4cd69a1028da671ef704574b4e9d4.txt +++ b/analysis/statistics/16d7754fb4a4cd69a1028da671ef704574b4e9d4.txt @@ -1,6 +1,7 @@ changeset: 1218:16d7754fb4a4cd69a1028da671ef704574b4e9d4 -char kNewtonVersion[] = "0.3-alpha- () (build 04-22-2022-10:04-mupei@LAPTOP-179TJAMV-Linux-4.4.0-22000-Microsoft-x86_64)"; + +char kNewtonVersion[] = "0.3-alpha-1218 (16d7754fb4a4cd69a1028da671ef704574b4e9d4) (build 04-15-2022-14:04-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; ./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s diff --git a/analysis/statistics/1808151ae6b905cbe574df3ed2db14d13367609c.txt b/analysis/statistics/1808151ae6b905cbe574df3ed2db14d13367609c.txt new file mode 100644 index 000000000..cef055cb6 --- /dev/null +++ b/analysis/statistics/1808151ae6b905cbe574df3ed2db14d13367609c.txt @@ -0,0 +1,48 @@ + +changeset: 1227:1808151ae6b905cbe574df3ed2db14d13367609c +char kNewtonVersion[] = "0.3-alpha-1227 (1808151ae6b905cbe574df3ed2db14d13367609c) (build 06-06-2022-17:36-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/279754a0b3665b3baee486d37e61ff6d0f6904e8.txt b/analysis/statistics/279754a0b3665b3baee486d37e61ff6d0f6904e8.txt new file mode 100644 index 000000000..b00f6b56f --- /dev/null +++ b/analysis/statistics/279754a0b3665b3baee486d37e61ff6d0f6904e8.txt @@ -0,0 +1,48 @@ + +changeset: 1247:279754a0b3665b3baee486d37e61ff6d0f6904e8 +char kNewtonVersion[] = "0.3-alpha-1247 (279754a0b3665b3baee486d37e61ff6d0f6904e8) (build 07-08-2022-13:25-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/2ed4676fadc4e25f48a265d7cf3887accde6cdb8.txt b/analysis/statistics/2ed4676fadc4e25f48a265d7cf3887accde6cdb8.txt new file mode 100644 index 000000000..1a237dd8a --- /dev/null +++ b/analysis/statistics/2ed4676fadc4e25f48a265d7cf3887accde6cdb8.txt @@ -0,0 +1,46 @@ + +changeset: 1216:2ed4676fadc4e25f48a265d7cf3887accde6cdb8 +char kNewtonVersion[] = "0.3-alpha-1216 (2ed4676fadc4e25f48a265d7cf3887accde6cdb8) (build 03-17-2022-18:37-koma@TheMothership-Linux-5.16.14-arch1-1-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/8de02aa61d2056e16f8ba12999d7cce9f0d88f48.txt b/analysis/statistics/8de02aa61d2056e16f8ba12999d7cce9f0d88f48.txt new file mode 100644 index 000000000..7c6d553d2 --- /dev/null +++ b/analysis/statistics/8de02aa61d2056e16f8ba12999d7cce9f0d88f48.txt @@ -0,0 +1,48 @@ + +changeset: 1226:8de02aa61d2056e16f8ba12999d7cce9f0d88f48 +char kNewtonVersion[] = "0.3-alpha-1226 (8de02aa61d2056e16f8ba12999d7cce9f0d88f48) (build 06-06-2022-17:27-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/8fd2e2ddb2eb4ccf0beb25c15dc26601b9c93c82.txt b/analysis/statistics/8fd2e2ddb2eb4ccf0beb25c15dc26601b9c93c82.txt new file mode 100644 index 000000000..18c69ac8e --- /dev/null +++ b/analysis/statistics/8fd2e2ddb2eb4ccf0beb25c15dc26601b9c93c82.txt @@ -0,0 +1,4 @@ + +changeset: 1245:8fd2e2ddb2eb4ccf0beb25c15dc26601b9c93c82 +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt diff --git a/analysis/statistics/9cbcc3328c03ef7c68f9a27da8d386b06dad905c.txt b/analysis/statistics/9cbcc3328c03ef7c68f9a27da8d386b06dad905c.txt new file mode 100644 index 000000000..6098ea499 --- /dev/null +++ b/analysis/statistics/9cbcc3328c03ef7c68f9a27da8d386b06dad905c.txt @@ -0,0 +1,48 @@ + +changeset: 1225:9cbcc3328c03ef7c68f9a27da8d386b06dad905c +char kNewtonVersion[] = "0.3-alpha-1225 (9cbcc3328c03ef7c68f9a27da8d386b06dad905c) (build 06-06-2022-17:24-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/9f08cd5b9ad7957b2561752f29e6af797d8aeabf.txt b/analysis/statistics/9f08cd5b9ad7957b2561752f29e6af797d8aeabf.txt new file mode 100644 index 000000000..2e394683b --- /dev/null +++ b/analysis/statistics/9f08cd5b9ad7957b2561752f29e6af797d8aeabf.txt @@ -0,0 +1,48 @@ + +changeset: 1221:9f08cd5b9ad7957b2561752f29e6af797d8aeabf +char kNewtonVersion[] = "0.3-alpha-1221 (9f08cd5b9ad7957b2561752f29e6af797d8aeabf) (build 04-15-2022-19:39-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/aa7effbeb449550bc7e1863950dfa85bf8e5f42e.txt b/analysis/statistics/aa7effbeb449550bc7e1863950dfa85bf8e5f42e.txt new file mode 100644 index 000000000..1f66dff4d --- /dev/null +++ b/analysis/statistics/aa7effbeb449550bc7e1863950dfa85bf8e5f42e.txt @@ -0,0 +1,48 @@ + +changeset: 1219:aa7effbeb449550bc7e1863950dfa85bf8e5f42e +char kNewtonVersion[] = "0.3-alpha-1219 (aa7effbeb449550bc7e1863950dfa85bf8e5f42e) (build 04-15-2022-19:36-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/b59743ffc57dd374fd0ef576970dfb6b33f2a8b4.txt b/analysis/statistics/b59743ffc57dd374fd0ef576970dfb6b33f2a8b4.txt new file mode 100644 index 000000000..839ae3d3e --- /dev/null +++ b/analysis/statistics/b59743ffc57dd374fd0ef576970dfb6b33f2a8b4.txt @@ -0,0 +1,48 @@ + +changeset: 1254:b59743ffc57dd374fd0ef576970dfb6b33f2a8b4 +char kNewtonVersion[] = "0.3-alpha-1254 (b59743ffc57dd374fd0ef576970dfb6b33f2a8b4) (build 07-28-2022-12:56-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/b5b18fa437db62228f47c83c8d277e37d67aecb1.txt b/analysis/statistics/b5b18fa437db62228f47c83c8d277e37d67aecb1.txt new file mode 100644 index 000000000..dbeb2c11e --- /dev/null +++ b/analysis/statistics/b5b18fa437db62228f47c83c8d277e37d67aecb1.txt @@ -0,0 +1,48 @@ + +changeset: 1246:b5b18fa437db62228f47c83c8d277e37d67aecb1 +char kNewtonVersion[] = "0.3-alpha-1246 (b5b18fa437db62228f47c83c8d277e37d67aecb1) (build 07-08-2022-13:12-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/c2f753125e8eef73dd65ce608ce92327c253af9b.txt b/analysis/statistics/c2f753125e8eef73dd65ce608ce92327c253af9b.txt new file mode 100644 index 000000000..afd67df5e --- /dev/null +++ b/analysis/statistics/c2f753125e8eef73dd65ce608ce92327c253af9b.txt @@ -0,0 +1,48 @@ + +changeset: 1219:c2f753125e8eef73dd65ce608ce92327c253af9b +char kNewtonVersion[] = "0.3-alpha-1219 (c2f753125e8eef73dd65ce608ce92327c253af9b) (build 04-15-2022-14:06-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/c9f9f40b41280dc1be859b71ddaee080c65ddf9f.txt b/analysis/statistics/c9f9f40b41280dc1be859b71ddaee080c65ddf9f.txt new file mode 100644 index 000000000..dc0a7d0b7 --- /dev/null +++ b/analysis/statistics/c9f9f40b41280dc1be859b71ddaee080c65ddf9f.txt @@ -0,0 +1,48 @@ + +changeset: 1226:c9f9f40b41280dc1be859b71ddaee080c65ddf9f +char kNewtonVersion[] = "0.3-alpha-1226 (c9f9f40b41280dc1be859b71ddaee080c65ddf9f) (build 06-06-2022-17:43-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/cdd42b8c373927183a6d11cc8dea1221cf697583.txt b/analysis/statistics/cdd42b8c373927183a6d11cc8dea1221cf697583.txt new file mode 100644 index 000000000..14e183e01 --- /dev/null +++ b/analysis/statistics/cdd42b8c373927183a6d11cc8dea1221cf697583.txt @@ -0,0 +1,48 @@ + +changeset: 1220:cdd42b8c373927183a6d11cc8dea1221cf697583 +char kNewtonVersion[] = "0.3-alpha-1220 (cdd42b8c373927183a6d11cc8dea1221cf697583) (build 04-15-2022-19:38-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/d67b56ec86a0a159728057f52b4d90d38a039ef3.txt b/analysis/statistics/d67b56ec86a0a159728057f52b4d90d38a039ef3.txt new file mode 100644 index 000000000..4d3a1a6a8 --- /dev/null +++ b/analysis/statistics/d67b56ec86a0a159728057f52b4d90d38a039ef3.txt @@ -0,0 +1,48 @@ + +changeset: 1223:d67b56ec86a0a159728057f52b4d90d38a039ef3 +char kNewtonVersion[] = "0.3-alpha-1223 (d67b56ec86a0a159728057f52b4d90d38a039ef3) (build 05-13-2022-18:02-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/da376a2d6e83b6033d4fb492eaeabf0743ddc463.txt b/analysis/statistics/da376a2d6e83b6033d4fb492eaeabf0743ddc463.txt new file mode 100644 index 000000000..ff07dedd5 --- /dev/null +++ b/analysis/statistics/da376a2d6e83b6033d4fb492eaeabf0743ddc463.txt @@ -0,0 +1,48 @@ + +changeset: 1220:da376a2d6e83b6033d4fb492eaeabf0743ddc463 +char kNewtonVersion[] = "0.3-alpha-1220 (da376a2d6e83b6033d4fb492eaeabf0743ddc463) (build 04-15-2022-19:34-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/de736fbbe7678568e91dce01d0cb04d4fda8f83f.txt b/analysis/statistics/de736fbbe7678568e91dce01d0cb04d4fda8f83f.txt new file mode 100644 index 000000000..2feb9fab5 --- /dev/null +++ b/analysis/statistics/de736fbbe7678568e91dce01d0cb04d4fda8f83f.txt @@ -0,0 +1,48 @@ + +changeset: 1249:de736fbbe7678568e91dce01d0cb04d4fda8f83f +char kNewtonVersion[] = "0.3-alpha-1249 (de736fbbe7678568e91dce01d0cb04d4fda8f83f) (build 07-08-2022-17:12-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/e1cc160cfece52b2cb548f351171c2e932a968a9.txt b/analysis/statistics/e1cc160cfece52b2cb548f351171c2e932a968a9.txt new file mode 100644 index 000000000..b4c3306b0 --- /dev/null +++ b/analysis/statistics/e1cc160cfece52b2cb548f351171c2e932a968a9.txt @@ -0,0 +1,48 @@ + +changeset: 1238:e1cc160cfece52b2cb548f351171c2e932a968a9 +char kNewtonVersion[] = "0.3-alpha-1238 (e1cc160cfece52b2cb548f351171c2e932a968a9) (build 06-17-2022-12:24-blackgeorge@blackgeorge-IdeaPad-L340-17IRH-Gaming-Linux-5.3.0-62-generic-x86_64)"; + +./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s + +./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/applications/newton/llvm-ir/README.md b/applications/newton/llvm-ir/README.md index d0d229a63..7ee118d73 100644 --- a/applications/newton/llvm-ir/README.md +++ b/applications/newton/llvm-ir/README.md @@ -20,6 +20,19 @@ cd ../../../../src/newton ./ --llvm-ir=../../applications/newton/llvm-ir/adc_test/test_hum_adc.ll ../../applications/newton/invariants/LLVMIRNewtonExample.nt ``` +### Arrays with variable indices + +```make +cd /path/to/Noisy-lang-compiler/applications/newton/llvm-ir/array-element-physics +make +cd ../../../../src/newton +./ --llvm-ir=../../applications/newton/llvm-ir/array-element-physics/main.ll ../../applications/newton/invariants/LLVMIRNewtonExample.nt +cd - +make main_opt.ll +make main +./main +``` + ## Liveness check with Newton and LLVM IR Pass the flag `--llvm-ir-liveness-check`, to do a liveness check for a LLVM IR file given with `--llvm-ir`. diff --git a/applications/newton/llvm-ir/array-element-physics/Makefile b/applications/newton/llvm-ir/array-element-physics/Makefile index 825e15a60..5251df421 100644 --- a/applications/newton/llvm-ir/array-element-physics/Makefile +++ b/applications/newton/llvm-ir/array-element-physics/Makefile @@ -4,14 +4,27 @@ endif LLVM_CONFIG:=llvm-config CC:=clang # Currently tested with clang-12/clang-13 +LLC:=llc +LLVM-DIS:= llvm-dis COMMON_FLAGS=-Wall -Wextra default: main.ll +main : main.o runtime_dimensionality_check.o + $(_QUIET)$(CC) $^ -o $@ + +main.o : main.bc + $(_QUIET)$(LLC) -filetype=obj $< -o $@ + +main_opt.ll : main.bc + $(_QUIET)$(LLVM-DIS) $< -o $@ %.ll : %.c $(_QUIET)$(CC) -g -S -emit-llvm $(COMMON_FLAGS) -o $@ $< +runtime_dimensionality_check.o : runtime_dimensionality_check.c + $(_QUIET)$(CC) -o $@ -c $< + clean:: - $(_QUIET)rm -f *.ll + $(_QUIET)rm -f *.ll *.o *.bc main diff --git a/applications/newton/llvm-ir/array-element-physics/main.c b/applications/newton/llvm-ir/array-element-physics/main.c index f6362f744..77d841044 100644 --- a/applications/newton/llvm-ir/array-element-physics/main.c +++ b/applications/newton/llvm-ir/array-element-physics/main.c @@ -2,7 +2,8 @@ typedef double time; typedef double distance; typedef double speed; -int + +int main(int argc, char const *argv[]) { double state[2]; @@ -14,9 +15,15 @@ main(int argc, char const *argv[]) state[0] = x; state[1] = v; + x = x + x; + v = v + v; + x = state[0] + state[0]; + /* Next state */ - state[0] = state[0] + v*dt; - state[1] = state[1]; /* constant velocity */ + for (int i = 0; i < 10; i++) + { + state[0] = state[i] + v*dt; + } return 0; } diff --git a/applications/newton/llvm-ir/array-element-physics/runtime_dimensionality_check.c b/applications/newton/llvm-ir/array-element-physics/runtime_dimensionality_check.c new file mode 100644 index 000000000..b8137b376 --- /dev/null +++ b/applications/newton/llvm-ir/array-element-physics/runtime_dimensionality_check.c @@ -0,0 +1,205 @@ +/* + Authored 2021. Nikos Mavrogeorgis. + Authored 2022. Orestis Kaparounakis. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + * Neither the name of the author nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include + +enum DefaultConstantsE { + kSymbolDimensionTableSize = 1024, + kMaxDimensions = 1024 +} DefaultConstants; + +/* + * A table that maps values to signals. The index i corresponds to the symbol + * while the value symbolSignalTable[i] corresponds to the signal. + * + * A value of `0` means the index has not been matched to a symbol. + */ +static int64_t ** symbolSignalTable; + +void +__newtonInit() +{ + symbolSignalTable = calloc(kSymbolDimensionTableSize, sizeof(int64_t*)); + if (symbolSignalTable == NULL) + { + fprintf(stderr, "Newton error: could not allocate memory for Newton runtime"); + exit(EXIT_FAILURE); + } +} + +/** + * @brief Inserts dimensions and returns an identifier for them. Use the + * identifier to check dimensions using `__newtonCheckDimensions`. Call + * `__newtonDelete` when symbol goes out of scope. + * + * @param dimensions The dimensions for the new symbol. + * @return size_t The symbol identifier for the just-inserted dimensions. + */ +size_t +__newtonInsert(int64_t dimensions[kMaxDimensions]) +{ + for (size_t i = 0; i < kSymbolDimensionTableSize; i++) + { + if (symbolSignalTable[i] == NULL) + { + symbolSignalTable[i] = calloc(kMaxDimensions, sizeof(int64_t)); + if (symbolSignalTable[i] == NULL) + { + fprintf(stderr, "Newton error: could not allocate memory for Newton runtime"); + exit(EXIT_FAILURE); + } + + for (size_t j = 0; j < kMaxDimensions; j++) + { + symbolSignalTable[i][j] = dimensions[j]; + } + + return i; + } + } + + fprintf(stderr, "Newton error: no space left"); + exit(EXIT_FAILURE); +} + +/** + * @brief Calculates the product of the dimensions for the given symbol + * identifiers and returns the identifier of the product. + * + * @param firstFactorSymbolID The symbol identifier of the first factor of the product. + * @param secondFactorSymbolID The symbol identifier of the second factor of the product. + * @return size_t The symbol identifier for the product. + */ +size_t +__newtonProductInsert(size_t firstFactorSymbolID, size_t secondFactorSymbolID) +{ + int64_t productDimensions[kMaxDimensions]; + + for (size_t i = 0; i < kMaxDimensions; i++) + { + productDimensions[i] = symbolSignalTable[firstFactorSymbolID][i] + symbolSignalTable[secondFactorSymbolID][i]; + } + + return __newtonInsert(productDimensions); +} + +/** + * @brief Calculates the quotient of the dimensions for the given symbol + * identifiers and returns the identifier of the quotient. + * + * @param firstFactorSymbolID The symbol identifier of the dividend. + * @param secondFactorSymbolID The symbol identifier of the divisor. + * @return size_t The symbol identifier for the quotient. + */ +size_t +__newtonQuotientInsert(size_t dividendSymbolID, size_t divisorSymbolID) +{ + int64_t quotientDimensions[kMaxDimensions]; + + for (size_t i = 0; i < kMaxDimensions; i++) + { + quotientDimensions[i] = symbolSignalTable[dividendSymbolID][i] - symbolSignalTable[divisorSymbolID][i]; + } + + return __newtonInsert(quotientDimensions); +} + +/** + * @brief Re-initializes the passed symbol identifer to not refer to any dimensions. + * + * @param symbolID The symbol identifier to release. + */ +void +__newtonDelete(size_t symbolID) +{ + free(symbolSignalTable[symbolID]); + symbolSignalTable[symbolID] = NULL; +} + +/** + * @brief Get the dimensions array for a given symbol identifier. + * + * @param symbolID The symbol identifier for which to fetch the dimensions. + * @param result A pointer to a int64_t array to place the result into. + * @return int Zero if successful. + */ +int +__newtonGetSymbolDimensions(size_t symbolID, int64_t result[kMaxDimensions]) +{ + if (symbolSignalTable[symbolID] == NULL) + { + return 1; + } + + for (size_t i = 0; i < kMaxDimensions; i++) + { + result[i] = symbolSignalTable[symbolID][i]; + return 0; + } +} + +/** + * @brief Checks for dimensional homogeneity for the dimensions of the given + * symbol identifiers. + * + * @param firstSymbolID + * @param secondSymbolID + * @return int Zero if homogenous. + */ +int +__newtonCheckDimensions(size_t firstSymbolID, size_t secondSymbolID) +{ + printf("Examining %d %d\n", firstSymbolID, secondSymbolID); + for (size_t i = 0; i < kMaxDimensions; i++) + { + if (symbolSignalTable[firstSymbolID][i] != symbolSignalTable[secondSymbolID][i]) + { + return 1; + } + } + + return 0; +} + +void +__array_dimensionality_check(int index, int * array) +{ + printf("Found index: %d, %p\n", index, array); +} diff --git a/src/newton/newton-irPass-LLVMIR-dimension-check.cpp b/src/newton/newton-irPass-LLVMIR-dimension-check.cpp index b5f5ab874..3a5cd9e3b 100644 --- a/src/newton/newton-irPass-LLVMIR-dimension-check.cpp +++ b/src/newton/newton-irPass-LLVMIR-dimension-check.cpp @@ -48,6 +48,10 @@ #include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" #include "llvm/IR/DebugInfoMetadata.h" +#include "llvm/IR/IRBuilder.h" +#include "llvm/Bitcode/BitcodeWriter.h" +#include "llvm/Support/Path.h" +#include "llvm/Support/JSON.h" using namespace llvm; @@ -78,23 +82,31 @@ extern "C" #include "newton-irPass-estimatorSynthesisBackend.h" #include "newton-irPass-invariantSignalAnnotation.h" + +enum DefaultConstantsE { + kMaxDimensions = 1024 +} DefaultConstants; + class PhysicsInfo { private: Physics * physicsType; std::vector members; - bool isComposite; + bool composite; public: - PhysicsInfo(): physicsType{nullptr}, isComposite{true} {}; - explicit PhysicsInfo(Physics * physics): physicsType{physics}, isComposite{false} {}; + PhysicsInfo(): physicsType{nullptr}, composite{true} {}; + explicit PhysicsInfo(Physics * physics): physicsType{physics}, composite{false} {}; - void pushPhysicsInfo(PhysicsInfo * physics_info) { if (isComposite) { members.push_back(physics_info); } } - void insertPhysicsInfoAt(PhysicsInfo * physics_info, uint64_t index) { if (isComposite) { members.at(index) = physics_info; } } + void pushPhysicsInfo(PhysicsInfo * physics_info) { if (composite) { members.push_back(physics_info); } } + void insertPhysicsInfoAt(PhysicsInfo * physics_info, uint64_t index) { if (composite) { members.at(index) = physics_info; } } - Physics* get_physics_type() { return physicsType; } + bool isComposite() const { return composite; } + Physics* getPhysicsType() { return physicsType; } std::vector get_members() { return members; } }; std::map virtualRegisterPhysicsTable; +std::map virtualRegisterIdentifier; +std::map sourceVariablePhysicsTable; /* * Get the physics info of the DIType. @@ -223,12 +235,37 @@ newtonPhysicsSubtractExponentsWrapper(State * N, Physics * left, Physics * ri } } -void -dimensionalityCheck(Function & llvmIrFunction, State * N) +void +dumpPhysicsInfoJSON(json::OStream &jsonOStream, StringRef name, PhysicsInfo* physicsInfo) +{ + if (physicsInfo->isComposite()) { + jsonOStream.attributeBegin(name); + jsonOStream.arrayBegin(); + for (auto &member : physicsInfo->get_members()) { + dumpPhysicsInfoJSON(jsonOStream, "", member); + } + jsonOStream.arrayEnd(); + jsonOStream.attributeEnd(); + } + else if (!name.empty()) + jsonOStream.attribute(name, physicsInfo->getPhysicsType()->identifier); + else + jsonOStream.value(physicsInfo->getPhysicsType()->identifier); +} + +void +dimensionalityCheck(Function & llvmIrFunction, State * N, FunctionCallee runtimeCheckFunction, FunctionCallee initNewtonRuntime, FunctionCallee newtonInsert, FunctionCallee newtonCheckDimensions) { + if (!llvmIrFunction.empty()) + { + Instruction * firstIrInstruction = llvmIrFunction.begin()->getFirstNonPHI(); + IRBuilder<> builder(firstIrInstruction); + builder.CreateCall(initNewtonRuntime, {}); + } + for (BasicBlock & llvmIrBasicBlock : llvmIrFunction) { - for (Instruction & llvmIrInstruction : llvmIrBasicBlock) + for (Instruction & llvmIrInstruction : llvmIrBasicBlock) { switch (llvmIrInstruction.getOpcode()) { @@ -270,6 +307,38 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) if (auto physicsInfo = newtonPhysicsInfo(debugInfoVariable->getType(), N)) { virtualRegisterPhysicsTable[localVariableAddress] = physicsInfo; + sourceVariablePhysicsTable[debugInfoVariable->getName()] = physicsInfo; + + if (!physicsInfo->isComposite()) + { + auto dimensionIterator = physicsInfo->getPhysicsType()->dimensions; + IRBuilder<> builder(&llvmIrInstruction); + Type * argumentType = runtimeCheckFunction.getFunctionType()->getParamType(0); + Type * pointerType = runtimeCheckFunction.getFunctionType()->getParamType(1); + Type * Int64Type = llvm::IntegerType::getInt64Ty(builder.getContext()); + + auto element_size = llvm::ConstantInt::get(Int64Type, sizeof(int64_t)); + auto array_size = llvm::ConstantInt::get(Int64Type, kMaxDimensions); + auto alloc_size = llvm::ConstantExpr::getMul(element_size, array_size); + + Instruction* Malloc = CallInst::CreateMalloc(&llvmIrInstruction, + Int64Type, Int64Type->getPointerTo(), alloc_size, + nullptr, nullptr, ""); + auto pointerIndex = builder.CreatePointerCast(Malloc, pointerType); + Value * locationPointer; + int64_t exponent; + for (int64_t i = 0; dimensionIterator; dimensionIterator = dimensionIterator->next, i++) + { + exponent = (int64_t)dimensionIterator->exponent; + if (exponent) + { + locationPointer = builder.CreateGEP(pointerIndex, llvm::ConstantInt::get(Int64Type, i)); + builder.CreateStore(llvm::ConstantInt::get(Int64Type, exponent), locationPointer); + } + } + auto symbolNumber = builder.CreateCall(newtonInsert, {pointerIndex}); + virtualRegisterIdentifier[localVariableAddress] = symbolNumber; + } } } } @@ -286,29 +355,39 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) case Instruction::FCmp: { PhysicsInfo * leftTerm = virtualRegisterPhysicsTable[llvmIrInstruction.getOperand(0)]; PhysicsInfo * rightTerm = virtualRegisterPhysicsTable[llvmIrInstruction.getOperand(1)]; + Value * leftIdentifier = virtualRegisterIdentifier[llvmIrInstruction.getOperand(0)]; + Value * rightIdentifier = virtualRegisterIdentifier[llvmIrInstruction.getOperand(1)]; Physics * physicsSum; + if (leftIdentifier && rightIdentifier) + { + IRBuilder<> builder(&llvmIrInstruction); + Type * argumentType = newtonCheckDimensions.getFunctionType()->getParamType(0); + auto leftIndex = builder.CreateIntCast(leftIdentifier, argumentType, true); + auto rightIndex = builder.CreateIntCast(rightIdentifier, argumentType, true); + builder.CreateCall(newtonCheckDimensions, {leftIndex, rightIndex}); + } if (!leftTerm) { if (!rightTerm) { break; } - physicsSum = rightTerm->get_physics_type(); + physicsSum = rightTerm->getPhysicsType(); } else if (!rightTerm) { - physicsSum = leftTerm->get_physics_type(); + physicsSum = leftTerm->getPhysicsType(); } else { - if (!areTwoPhysicsEquivalent(N, leftTerm->get_physics_type(), - rightTerm->get_physics_type())) + if (!areTwoPhysicsEquivalent(N, leftTerm->getPhysicsType(), + rightTerm->getPhysicsType())) { printDebugInfoLocation(&llvmIrInstruction, - leftTerm->get_physics_type(), rightTerm->get_physics_type()); + leftTerm->getPhysicsType(), rightTerm->getPhysicsType()); exit(1); } - physicsSum = leftTerm->get_physics_type(); + physicsSum = leftTerm->getPhysicsType(); } virtualRegisterPhysicsTable.insert({&llvmIrInstruction, new PhysicsInfo{physicsSum}}); break; @@ -327,17 +406,17 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) { break; } - physicsProduct = rightTerm->get_physics_type(); + physicsProduct = rightTerm->getPhysicsType(); } else if (!rightTerm) { - physicsProduct = leftTerm->get_physics_type(); + physicsProduct = leftTerm->getPhysicsType(); } else { physicsProduct = newtonPhysicsAddExponentsWrapper(N, - leftTerm->get_physics_type(), - rightTerm->get_physics_type()); + leftTerm->getPhysicsType(), + rightTerm->getPhysicsType()); } /* * Store the result to the destination virtual register. @@ -363,17 +442,17 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) { break; } - physicsProduct = rightTerm->get_physics_type(); + physicsProduct = rightTerm->getPhysicsType(); } else if (!rightTerm) { - physicsProduct = leftTerm->get_physics_type(); + physicsProduct = leftTerm->getPhysicsType(); } else { physicsProduct = newtonPhysicsSubtractExponentsWrapper(N, - leftTerm->get_physics_type(), - rightTerm->get_physics_type()); + leftTerm->getPhysicsType(), + rightTerm->getPhysicsType()); } /* * Store the result to the destination virtual register. @@ -390,6 +469,7 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) if (auto llvmIrLoadInstruction = dyn_cast(&llvmIrInstruction)) { virtualRegisterPhysicsTable.insert({llvmIrLoadInstruction, virtualRegisterPhysicsTable[llvmIrLoadInstruction->getOperand(0)]}); + virtualRegisterIdentifier.insert({llvmIrLoadInstruction, virtualRegisterIdentifier[llvmIrLoadInstruction->getOperand(0)]}); } break; @@ -433,12 +513,15 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) } } virtualRegisterPhysicsTable.insert({rightTerm, virtualRegisterPhysicsTable[leftTerm]}); + virtualRegisterIdentifier.insert({rightTerm, virtualRegisterIdentifier[leftTerm]}); break; } - if (!areTwoPhysicsEquivalent(N, leftPhysicsInfo->get_physics_type(), rightPhysicsInfo->get_physics_type())) + if (!areTwoPhysicsEquivalent(N, leftPhysicsInfo->getPhysicsType(), + rightPhysicsInfo->getPhysicsType())) { printDebugInfoLocation(&llvmIrInstruction, - leftPhysicsInfo->get_physics_type(), rightPhysicsInfo->get_physics_type()); + leftPhysicsInfo->getPhysicsType(), + rightPhysicsInfo->getPhysicsType()); exit(1); } } @@ -447,8 +530,22 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) case Instruction::GetElementPtr: if (auto llvmIrGetElementPointerInstruction = dyn_cast(&llvmIrInstruction)) { + uint8_t operandsNumber = llvmIrGetElementPointerInstruction->getNumOperands(); uint64_t index; - if (auto llvmIrConstantInt = dyn_cast(llvmIrGetElementPointerInstruction->getOperand(2))) + + /* + * TODO: handle all cases with arrays and pointers. + */ + if (operandsNumber != 3) + { + continue; + } + + /* + * For one-dimensional arrays the 3rd operand is the index of the expression. + */ + Value * indexOperand = llvmIrGetElementPointerInstruction->getOperand(2); + if (auto llvmIrConstantInt = dyn_cast(indexOperand)) { Value * structurePointer = llvmIrGetElementPointerInstruction->getPointerOperand(); PhysicsInfo * structurePointerPhysicsInfo = virtualRegisterPhysicsTable[structurePointer]; @@ -457,6 +554,57 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) index = llvmIrConstantInt->getZExtValue(); physicsInfo = structurePointerPhysicsInfo->get_members()[index]; virtualRegisterPhysicsTable.insert({llvmIrGetElementPointerInstruction, physicsInfo}); + + if (physicsInfo) { + auto dimensionIterator = physicsInfo->getPhysicsType()->dimensions; + IRBuilder<> builder(&llvmIrInstruction); + Type *argumentType = runtimeCheckFunction.getFunctionType()->getParamType(0); + Type *pointerType = runtimeCheckFunction.getFunctionType()->getParamType(1); + Type *Int64Type = llvm::IntegerType::getInt64Ty(builder.getContext()); + + auto element_size = llvm::ConstantInt::get(Int64Type, sizeof(int64_t)); + auto array_size = llvm::ConstantInt::get(Int64Type, kMaxDimensions); + auto alloc_size = llvm::ConstantExpr::getMul(element_size, array_size); + + Instruction *Malloc = CallInst::CreateMalloc(&llvmIrInstruction, + Int64Type, Int64Type->getPointerTo(), + alloc_size, + nullptr, nullptr, ""); + auto pointerIndex = builder.CreatePointerCast(Malloc, pointerType); + Value *locationPointer; + int64_t exponent; + for (int64_t i = 0; dimensionIterator; dimensionIterator = dimensionIterator->next, i++) { + exponent = (int64_t) dimensionIterator->exponent; + if (exponent) { + locationPointer = builder.CreateGEP(pointerIndex, + llvm::ConstantInt::get(Int64Type, i)); + builder.CreateStore(llvm::ConstantInt::get(Int64Type, exponent), + locationPointer); + } + } + auto symbolNumber = builder.CreateCall(newtonInsert, {pointerIndex}); + virtualRegisterIdentifier.insert({llvmIrGetElementPointerInstruction, symbolNumber}); + } + } + else + { + IRBuilder<> builder(&llvmIrInstruction); + llvm::Type *i64Type = llvm::IntegerType::getInt64Ty(builder.getContext()); + + Type * argumentType = runtimeCheckFunction.getFunctionType()->getParamType(0); + Type * pointerType = runtimeCheckFunction.getFunctionType()->getParamType(1); + + auto element_size = llvm::ConstantInt::get(i64Type, 8); + auto array_size = llvm::ConstantInt::get(i64Type, 100); + auto alloc_size = llvm::ConstantExpr::getMul(element_size, array_size); + + Instruction* Malloc = CallInst::CreateMalloc(&llvmIrInstruction, + i64Type, i64Type->getPointerTo(), alloc_size, + nullptr, nullptr, ""); + + auto variableIndex = builder.CreateIntCast(indexOperand, argumentType, true); + auto pointerIndex = builder.CreatePointerCast(Malloc, pointerType); + builder.CreateCall(runtimeCheckFunction, {variableIndex, pointerIndex}); } } break; @@ -494,23 +642,23 @@ dimensionalityCheck(Function & llvmIrFunction, State * N) { break; } - physicsPhiNode = rightTerm->get_physics_type(); + physicsPhiNode = rightTerm->getPhysicsType(); } else if (!rightTerm) { - physicsPhiNode = leftTerm->get_physics_type(); + physicsPhiNode = leftTerm->getPhysicsType(); } else { - if (!areTwoPhysicsEquivalent(N, leftTerm->get_physics_type(), - rightTerm->get_physics_type())) + if (!areTwoPhysicsEquivalent(N, leftTerm->getPhysicsType(), + rightTerm->getPhysicsType())) { auto debugLocation = cast(llvmIrInstruction.getMetadata(0)); errs() << "Warning, cannot deduce physics type at: line " << debugLocation->getLine() << ", column " << debugLocation->getColumn() << ".\n"; } - physicsPhiNode = leftTerm->get_physics_type(); + physicsPhiNode = leftTerm->getPhysicsType(); } virtualRegisterPhysicsTable.insert({&llvmIrInstruction, new PhysicsInfo{physicsPhiNode}}); } @@ -580,6 +728,23 @@ irPassLLVMIRDimensionCheck(State * N) fatal(N, Esanity); } + StringRef filePath(N->llvmIR); + std::string filePathStem; + std::string modifiedIRFilePath; + std::string JSONFilePath; + + std::error_code errorCode(errno,std::generic_category()); + + filePathStem = std::string(sys::path::parent_path(filePath)) + "/" + std::string(sys::path::stem(filePath)); + + modifiedIRFilePath = filePathStem + ".bc"; + raw_fd_ostream modifiedIROutputFile(modifiedIRFilePath, errorCode); + + JSONFilePath = filePathStem + ".json"; + raw_fd_ostream JSONOutputFile(JSONFilePath, errorCode); + int JSONPrettyPrinting = true; + json::OStream jsonOStream(JSONOutputFile, JSONPrettyPrinting); + SMDiagnostic Err; LLVMContext Context; std::unique_ptr Mod(parseIRFile(N->llvmIR, Err, Context)); @@ -589,10 +754,27 @@ irPassLLVMIRDimensionCheck(State * N) fatal(N, Esanity); } + Type *VoidType = Type::getVoidTy(Context); + Type *Int64Type = Type::getInt64Ty(Context); + Type *Int64PointerType = Type::getInt64PtrTy(Context); + + FunctionCallee arrayDimensionalityCheck = Mod->getOrInsertFunction("__array_dimensionality_check", /* return type */ VoidType, Int64Type, Int64PointerType); + FunctionCallee initNewtonRuntime = Mod->getOrInsertFunction("__newtonInit", /* return type */ VoidType); + FunctionCallee newtonInsert = Mod->getOrInsertFunction("__newtonInsert", /* return type */ Int64Type, Int64PointerType); + FunctionCallee newtonCheckDimensions = Mod->getOrInsertFunction("__newtonCheckDimensions", /* return type */ Int64Type, Int64Type, Int64Type); + for (auto & mi : *Mod) { - dimensionalityCheck(mi, N); + dimensionalityCheck(mi, N, arrayDimensionalityCheck, initNewtonRuntime, newtonInsert, newtonCheckDimensions); } + + WriteBitcodeToFile(*Mod, modifiedIROutputFile); + + jsonOStream.object([&] { + for (auto &iter: sourceVariablePhysicsTable) { + dumpPhysicsInfoJSON(jsonOStream, iter.first, iter.second); + } + }); } }