From c3f61b1ed7f6c81e0025ffbd70105c5b72fb7823 Mon Sep 17 00:00:00 2001 From: moisesmcardona Date: Mon, 7 Sep 2020 11:48:26 -0400 Subject: [PATCH] PAQCompress v0.4 --- Changelog.txt | 7 ++++ PAQCompress/Form1.Designer.vb | 36 +++++++++++------ PAQCompress/Form1.vb | 43 ++++++++++++++++++--- PAQCompress/My Project/AssemblyInfo.vb | 4 +- PAQCompress/My Project/Settings.Designer.vb | 12 ++++++ PAQCompress/My Project/Settings.settings | 3 ++ PAQCompress/app.config | 3 ++ 7 files changed, 90 insertions(+), 18 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index e296159..50b1f1c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,10 @@ +v0.4 +- Added new Use AVX2-optimized build" (Native CPU) option to use AVX2-optimized paq8px builds (v190 and up) +- Files compressed with "Native CPU" versions will have .native appended to the filename before the paq8px version. + - NOTE that native CPU versions must be used to extract the files if initially compressed with a native CPU compressor. + - Some versions may have issues on different CPU architectures. +- Added paq8px v191, v191a, v192, v193, v193fix1 and v193fix2. + v0.3.54 - Added paq8px v190. - Added new R flag for paq8px v190. diff --git a/PAQCompress/Form1.Designer.vb b/PAQCompress/Form1.Designer.vb index 0f4b7ab..5673b3e 100644 --- a/PAQCompress/Form1.Designer.vb +++ b/PAQCompress/Form1.Designer.vb @@ -40,6 +40,7 @@ Partial Class Form1 Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.CompressionLevel = New System.Windows.Forms.ComboBox() Me.GroupBox2 = New System.Windows.Forms.GroupBox() + Me.r_flag = New System.Windows.Forms.CheckBox() Me.l_flag = New System.Windows.Forms.CheckBox() Me.DontCreateTextFile = New System.Windows.Forms.CheckBox() Me.f_flag = New System.Windows.Forms.CheckBox() @@ -64,7 +65,7 @@ Partial Class Form1 Me.GenerateBatchScriptOnly = New System.Windows.Forms.CheckBox() Me.SendToDistributedProject = New System.Windows.Forms.CheckBox() Me.DistributedProcessingOptions = New System.Windows.Forms.Button() - Me.r_flag = New System.Windows.Forms.CheckBox() + Me.useNativeCPU = New System.Windows.Forms.CheckBox() Me.GroupBox3.SuspendLayout() Me.GroupBox4.SuspendLayout() Me.GroupBox5.SuspendLayout() @@ -250,6 +251,16 @@ Partial Class Form1 Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "PAQ8PX Additional Options:" ' + 'r_flag + ' + Me.r_flag.AutoSize = True + Me.r_flag.Location = New System.Drawing.Point(268, 88) + Me.r_flag.Name = "r_flag" + Me.r_flag.Size = New System.Drawing.Size(265, 17) + Me.r_flag.TabIndex = 20 + Me.r_flag.Text = "Perform initial retraining of the LSTM on text blocks" + Me.r_flag.UseVisualStyleBackColor = True + ' 'l_flag ' Me.l_flag.AutoSize = True @@ -391,9 +402,9 @@ Partial Class Form1 Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(9, 465) Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(167, 13) + Me.Label3.Size = New System.Drawing.Size(152, 13) Me.Label3.TabIndex = 21 - Me.Label3.Text = "v0.3.54 - GUI by: Moisés Cardona" + Me.Label3.Text = "v0.4 - GUI by: Moisés Cardona" ' 'paq_other ' @@ -457,15 +468,16 @@ Partial Class Form1 Me.DistributedProcessingOptions.UseVisualStyleBackColor = True Me.DistributedProcessingOptions.Visible = False ' - 'r_flag + 'useNativeCPU ' - Me.r_flag.AutoSize = True - Me.r_flag.Location = New System.Drawing.Point(268, 88) - Me.r_flag.Name = "r_flag" - Me.r_flag.Size = New System.Drawing.Size(265, 17) - Me.r_flag.TabIndex = 20 - Me.r_flag.Text = "Perform initial retraining of the LSTM on text blocks" - Me.r_flag.UseVisualStyleBackColor = True + Me.useNativeCPU.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.useNativeCPU.AutoSize = True + Me.useNativeCPU.Location = New System.Drawing.Point(304, 378) + Me.useNativeCPU.Name = "useNativeCPU" + Me.useNativeCPU.Size = New System.Drawing.Size(147, 17) + Me.useNativeCPU.TabIndex = 26 + Me.useNativeCPU.Text = "Use AVX2-optimized build" + Me.useNativeCPU.UseVisualStyleBackColor = True ' 'Form1 ' @@ -473,6 +485,7 @@ Partial Class Form1 Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(1052, 487) + Me.Controls.Add(Me.useNativeCPU) Me.Controls.Add(Me.DistributedProcessingOptions) Me.Controls.Add(Me.SendToDistributedProject) Me.Controls.Add(Me.GenerateBatchScriptOnly) @@ -555,4 +568,5 @@ End Sub Friend WithEvents DontCreateTextFile As CheckBox Friend WithEvents l_flag As CheckBox Friend WithEvents r_flag As CheckBox + Friend WithEvents useNativeCPU As CheckBox End Class diff --git a/PAQCompress/Form1.vb b/PAQCompress/Form1.vb index 274ca73..5ee34a4 100644 --- a/PAQCompress/Form1.vb +++ b/PAQCompress/Form1.vb @@ -6,10 +6,12 @@ Private Const paq8px_enable_levels_10_12 = 94 Private Const paq8px_enable_l_flag = 98 Private Const paq8px_enable_r_flag = 100 + Private Const change_r_flag_text = 102 Private Const fp8sk_enable_level_9 = 6 Private Const paq8pxd_add_x_levels As Integer = 28 + Private Const paq8px_nativecpus As Integer = 100 Private DistributedPAQCompressors As New Dictionary(Of String, String())() From {{"PAQ8PX", {"v185", "v186", "v186fix1", "v187", - "v187fix3", "v187fix5", "v188", "v189", "v190"}}, + "v187fix3", "v187fix5", "v188", "v189", "v193fix2"}}, {"PAQ8PXd", {"v85", "v86"}}} Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load @@ -31,6 +33,7 @@ f_flag.Checked = My.Settings.f_flag l_flag.Checked = My.Settings.l_flag r_flag.Checked = My.Settings.r_flag + useNativeCPU.Checked = My.Settings.useNativeCPU ShowCMD.Checked = My.Settings.ShowCMD GenerateBatchScriptOnly.Checked = My.Settings.OnlyGenerateBatchFile DontCreateTextFile.Checked = My.Settings.DontCreateTextFile @@ -91,6 +94,11 @@ Exit For End If Next + If Filename.Contains(".native.") Then + useNativeCPU.Checked = True + Else + useNativeCPU.Checked = False + End If End Sub Private Sub SetPAQVersion(Filename As String, Extension As String, Optional append_v As Boolean = True, Optional split_after_dot As Boolean = True) Dim split_paq_version As String() = Filename.Split({Extension}, StringSplitOptions.RemoveEmptyEntries) @@ -176,7 +184,7 @@ "v168", "v169", "v170", "v171", "v172", "v173", "v174", "v175", "v176", "v177", "v178", "v179", "v179fix1", "v179fix2", "v179fix3", "v179fix4", "v179fix5", "v180", "v181", "v181fix1", "v182", "v182fix1", "v182fix2", "v183", "v183fix1", "v184", "v185", "v186", "v186fix1", "v187", "v187fix1", "v187fix2", "v187fix3", "v187fix4", "v187fix5", - "v188", "v189", "v190"}) + "v188", "v189", "v190", "v191", "v191a", "v192", "v193", "v193fix1", "v193fix2"}) PAQVersion.Enabled = True End If If PAQVersion.Enabled Then @@ -261,7 +269,11 @@ If CompressRButton.Checked Then If PAQVersion.Enabled Then If (PAQSeries.SelectedItem Is "PAQ8PX" And PAQVersion.SelectedIndex > Flags_enable) Or PAQSeries.SelectedItem Is "PAQ8PXd" Or PAQSeries.SelectedItem Is "PAQ8PXv" Or PAQSeries.SelectedItem Is "PAQ8SK" Or PAQSeries.SelectedItem Is "FP8sk" Then - OutputName = Item + "." + PAQSeries.SelectedItem.ToString.ToLower + PAQVersion.SelectedItem.ToString().Remove(0, 1) + If useNativeCPU.Checked Then + OutputName = Item + ".native." + PAQSeries.SelectedItem.ToString.ToLower + PAQVersion.SelectedItem.ToString().Remove(0, 1) + Else + OutputName = Item + "." + PAQSeries.SelectedItem.ToString.ToLower + PAQVersion.SelectedItem.ToString().Remove(0, 1) + End If Else OutputName = Item + "." + PAQSeries.SelectedItem.ToString.ToLower + "_" + PAQVersion.SelectedItem.ToString() End If @@ -324,10 +336,14 @@ Else DisableFlagsCheckboxes() End If - Else DisableFlagsCheckboxes() End If + If PAQVersion.SelectedIndex > paq8px_nativecpus Then + useNativeCPU.Enabled = True + Else + useNativeCPU.Enabled = False + End If Else DisableFlagsCheckboxes() End If @@ -354,6 +370,11 @@ Else r_flag.Enabled = False End If + If PAQVersion.SelectedIndex > change_r_flag_text Then + r_flag.Text = "Load LSTM models when appropriate" + Else + r_flag.Text = "Perform initial retraining of the LSTM on text blocks" + End If End Sub Private Sub DisableFlagsCheckboxes() b_flag.Enabled = False @@ -364,6 +385,8 @@ f_flag.Enabled = False l_flag.Enabled = False r_flag.Enabled = False + r_flag.Text = "Perform initial retraining of the LSTM on text blocks" + useNativeCPU.Enabled = False DontCreateTextFile.Enabled = False End Sub @@ -474,7 +497,11 @@ ElseIf PAQSeries.SelectedItem Is "PAQ8PX" Then If PAQVersion.Items.Contains(PAQVersion.Text) Then If PAQVersion.SelectedIndex > paq8px_use_exe_in_folder Then - CompressorToUse = "Executables/PAQ8PX/" + PAQVersion.Text + "/paq8px_" + PAQVersion.Text + ".exe" + If useNativeCPU.Enabled And useNativeCPU.Checked Then + CompressorToUse = "Executables/PAQ8PX/" + PAQVersion.Text + "/paq8px_" + PAQVersion.Text + "_nativecpu.exe" + Else + CompressorToUse = "Executables/PAQ8PX/" + PAQVersion.Text + "/paq8px_" + PAQVersion.Text + ".exe" + End If Else CompressorToUse = "Executables/PAQ8PX/paq8px_" + PAQVersion.Text + ".exe" End If @@ -777,4 +804,10 @@ My.Settings.r_flag = r_flag.Checked My.Settings.Save() End Sub + + Private Sub useNativeCPU_CheckedChanged(sender As Object, e As EventArgs) Handles useNativeCPU.CheckedChanged + My.Settings.useNativeCPU = useNativeCPU.Checked + My.Settings.Save() + AdjustOutputFilename(InputLocation.Text) + End Sub End Class diff --git a/PAQCompress/My Project/AssemblyInfo.vb b/PAQCompress/My Project/AssemblyInfo.vb index 040e114..5f80738 100644 --- a/PAQCompress/My Project/AssemblyInfo.vb +++ b/PAQCompress/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/PAQCompress/My Project/Settings.Designer.vb b/PAQCompress/My Project/Settings.Designer.vb index 7d2d51b..82ef7bc 100644 --- a/PAQCompress/My Project/Settings.Designer.vb +++ b/PAQCompress/My Project/Settings.Designer.vb @@ -305,6 +305,18 @@ Namespace My Me("r_flag") = value End Set End Property + + _ + Public Property useNativeCPU() As Boolean + Get + Return CType(Me("useNativeCPU"),Boolean) + End Get + Set + Me("useNativeCPU") = value + End Set + End Property End Class End Namespace diff --git a/PAQCompress/My Project/Settings.settings b/PAQCompress/My Project/Settings.settings index 79b09d3..f4eb751 100644 --- a/PAQCompress/My Project/Settings.settings +++ b/PAQCompress/My Project/Settings.settings @@ -65,5 +65,8 @@ False + + False + \ No newline at end of file diff --git a/PAQCompress/app.config b/PAQCompress/app.config index 7eaf38e..9d8a995 100644 --- a/PAQCompress/app.config +++ b/PAQCompress/app.config @@ -90,6 +90,9 @@ False + + False +