Repository: kythe/kythe
Pull request #4155 (2019-10-22 00:32:17)

chore: Count required inputs by their corpus
Required inputs can specify a corpus that is different than the corpus specified by the compilation unit. Provide a count of required inputs by their own corpus to add another metric to compare kzips.


Patch:
diff --git a/kythe/go/platform/kzip/info/info.go b/kythe/go/platform/kzip/info/info.go
index 9281dde7e..8cf887305 100644
--- a/kythe/go/platform/kzip/info/info.go
+++ b/kythe/go/platform/kzip/info/info.go
@@ -51,14 +51,16 @@ func KzipInfo(f kzip.File, scanOpts ...kzip.ScanOption) (*apb.KzipInfo, error) {
 			cuCorpus = unknownCorpus
 		}
 		cuLang := u.Proto.GetVName().GetLanguage()
-		cuInfo := cuLangInfo(cuLang, corpusInfo(cuCorpus, kzipInfo))
+		cuInfo := cuLangInfo(cuCorpus, cuLang, kzipInfo)
 		cuInfo.Count++
 		cuInfo.Sources += int32(srcs.Len())
 
 		for _, ri := range u.Proto.RequiredInput {
 			cuInfo.RequiredInputs++
+			riCorpus := ri.GetVName().GetCorpus()
+			requiredInputInfo(riCorpus, cuLang, kzipInfo).Count++
 			if srcs.Contains(ri.Info.Path) {
-				corpora.Add(ri.GetVName().GetCorpus())
+				corpora.Add(riCorpus)
 			}
 		}
 		if len(corpora) != 1 {
@@ -78,6 +80,7 @@ func KzipInfo(f kzip.File, scanOpts ...kzip.ScanOption) (*apb.KzipInfo, error) {
 func KzipInfoTotalCount(infos []*apb.KzipInfo) apb.KzipInfo_CorpusInfo {
 	totals := apb.KzipInfo_CorpusInfo{
 		LanguageCompilationUnits: make(map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits),
+		LanguageRequiredInputs:   make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
 	}
 	for _, info := range infos {
 		for _, i := range info.GetCorpora() {
@@ -91,6 +94,14 @@ func KzipInfoTotalCount(infos []*apb.KzipInfo) apb.KzipInfo_CorpusInfo {
 				langTotal.Sources += stats.GetSources()
 				langTotal.RequiredInputs += stats.GetRequiredInputs()
 			}
+			for lang, stats := range i.GetLanguageRequiredInputs() {
+				total := totals.LanguageRequiredInputs[lang]
+				if total == nil {
+					total = &apb.KzipInfo_CorpusInfo_RequiredInputs{}
+					totals.LanguageRequiredInputs[lang] = total
+				}
+				total.Count += stats.GetCount()
+			}
 		}
 	}
 	return totals
@@ -102,34 +113,49 @@ func MergeKzipInfo(infos []*apb.KzipInfo) *apb.KzipInfo {
 
 	for _, i := range infos {
 		for corpus, cinfo := range i.GetCorpora() {
-			mergedCorpInfo := corpusInfo(corpus, kzipInfo)
 			for lang, cu := range cinfo.GetLanguageCompilationUnits() {
-				cui := cuLangInfo(lang, mergedCorpInfo)
+				cui := cuLangInfo(corpus, lang, kzipInfo)
 				cui.Count += cu.GetCount()
 				cui.Sources += cu.GetSources()
 				cui.RequiredInputs += cu.GetRequiredInputs()
 			}
+			for lang, cu := range cinfo.GetLanguageRequiredInputs() {
+				c := requiredInputInfo(corpus, lang, kzipInfo)
+				c.Count += cu.GetCount()
+			}
 		}
 	}
 	return kzipInfo
 }
 
+func cuLangInfo(corpus, lang string, kzipInfo *apb.KzipInfo) *apb.KzipInfo_CorpusInfo_CompilationUnits {
+	c := corpusInfo(corpus, kzipInfo)
+	cui := c.LanguageCompilationUnits[lang]
+	if cui == nil {
+		cui = &apb.KzipInfo_CorpusInfo_CompilationUnits{}
+		c.LanguageCompilationUnits[lang] = cui
+	}
+	return cui
+}
+
+func requiredInputInfo(corpus, lang string, kzipInfo *apb.KzipInfo) *apb.KzipInfo_CorpusInfo_RequiredInputs {
+	c := corpusInfo(corpus, kzipInfo)
+	lri := c.LanguageRequiredInputs[lang]
+	if lri == nil {
+		lri = &apb.KzipInfo_CorpusInfo_RequiredInputs{}
+		c.LanguageRequiredInputs[lang] = lri
+	}
+	return lri
+}
+
 func corpusInfo(corpus string, kzipInfo *apb.KzipInfo) *apb.KzipInfo_CorpusInfo {
 	i := kzipInfo.GetCorpora()[corpus]
 	if i == nil {
 		i = &apb.KzipInfo_CorpusInfo{
 			LanguageCompilationUnits: make(map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits),
+			LanguageRequiredInputs:   make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
 		}
 		kzipInfo.Corpora[corpus] = i
 	}
 	return i
 }
-
-func cuLangInfo(lang string, c *apb.KzipInfo_CorpusInfo) *apb.KzipInfo_CorpusInfo_CompilationUnits {
-	cui := c.LanguageCompilationUnits[lang]
-	if cui == nil {
-		cui = &apb.KzipInfo_CorpusInfo_CompilationUnits{}
-		c.LanguageCompilationUnits[lang] = cui
-	}
-	return cui
-}
diff --git a/kythe/proto/analysis.proto b/kythe/proto/analysis.proto
index 917de393c..4dbe7a0c8 100644
--- a/kythe/proto/analysis.proto
+++ b/kythe/proto/analysis.proto
@@ -199,6 +199,14 @@ message KzipInfo {
     // Map from compilation unit language to stats about compilation units with
     // that language.
     map<string, CompilationUnits> language_compilation_units = 3;
+
+    message RequiredInputs {
+      int32 count = 1;
+    }
+
+    // Map from required input language to count of required inputs that have
+    // this corpus in their VName.
+    map<string, RequiredInputs> language_required_inputs = 4;
   }
 
   // Map from corpus name to corpus info.
diff --git a/kythe/proto/analysis_go_proto/analysis.pb.go b/kythe/proto/analysis_go_proto/analysis.pb.go
index f2f03ccff..65fecab52 100644
--- a/kythe/proto/analysis_go_proto/analysis.pb.go
+++ b/kythe/proto/analysis_go_proto/analysis.pb.go
@@ -461,6 +461,7 @@ func (m *KzipInfo) GetCorpora() map[string]*KzipInfo_CorpusInfo {
 
 type KzipInfo_CorpusInfo struct {
 	LanguageCompilationUnits map[string]*KzipInfo_CorpusInfo_CompilationUnits `protobuf:"bytes,3,rep,name=language_compilation_units,json=languageCompilationUnits,proto3" json:"language_compilation_units,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+	LanguageRequiredInputs   map[string]*KzipInfo_CorpusInfo_RequiredInputs   `protobuf:"bytes,4,rep,name=language_required_inputs,json=languageRequiredInputs,proto3" json:"language_required_inputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
 	XXX_NoUnkeyedLiteral     struct{}                                         `json:"-"`
 	XXX_unrecognized         []byte                                           `json:"-"`
 	XXX_sizecache            int32                                            `json:"-"`
@@ -498,6 +499,13 @@ func (m *KzipInfo_CorpusInfo) GetLanguageCompilationUnits() map[string]*KzipInfo
 	return nil
 }
 
+func (m *KzipInfo_CorpusInfo) GetLanguageRequiredInputs() map[string]*KzipInfo_CorpusInfo_RequiredInputs {
+	if m != nil {
+		return m.LanguageRequiredInputs
+	}
+	return nil
+}
+
 type KzipInfo_CorpusInfo_CompilationUnits struct {
 	Count                int32    `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
 	Sources              int32    `protobuf:"varint,2,opt,name=sources,proto3" json:"sources,omitempty"`
@@ -553,6 +561,45 @@ func (m *KzipInfo_CorpusInfo_CompilationUnits) GetRequiredInputs() int32 {
 	return 0
 }
 
+type KzipInfo_CorpusInfo_RequiredInputs struct {
+	Count                int32    `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *KzipInfo_CorpusInfo_RequiredInputs) Reset()         { *m = KzipInfo_CorpusInfo_RequiredInputs{} }
+func (m *KzipInfo_CorpusInfo_RequiredInputs) String() string { return proto.CompactTextString(m) }
+func (*KzipInfo_CorpusInfo_RequiredInputs) ProtoMessage()    {}
+func (*KzipInfo_CorpusInfo_RequiredInputs) Descriptor() ([]byte, []int) {
+	return fileDescriptor_8e4ea7eca60afe48, []int{4, 0, 2}
+}
+
+func (m *KzipInfo_CorpusInfo_RequiredInputs) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_KzipInfo_CorpusInfo_RequiredInputs.Unmarshal(m, b)
+}
+func (m *KzipInfo_CorpusInfo_RequiredInputs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_KzipInfo_CorpusInfo_RequiredInputs.Marshal(b, m, deterministic)
+}
+func (m *KzipInfo_CorpusInfo_RequiredInputs) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_KzipInfo_CorpusInfo_RequiredInputs.Merge(m, src)
+}
+func (m *KzipInfo_CorpusInfo_RequiredInputs) XXX_Size() int {
+	return xxx_messageInfo_KzipInfo_CorpusInfo_RequiredInputs.Size(m)
+}
+func (m *KzipInfo_CorpusInfo_RequiredInputs) XXX_DiscardUnknown() {
+	xxx_messageInfo_KzipInfo_CorpusInfo_RequiredInputs.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_KzipInfo_CorpusInfo_RequiredInputs proto.InternalMessageInfo
+
+func (m *KzipInfo_CorpusInfo_RequiredInputs) GetCount() int32 {
+	if m != nil {
+		return m.Count
+	}
+	return 0
+}
+
 type FilesRequest struct {
 	Files                []*FileInfo `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
 	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
@@ -839,7 +886,9 @@ func init() {
 	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo)(nil), "kythe.proto.KzipInfo.CorporaEntry")
 	proto.RegisterType((*KzipInfo_CorpusInfo)(nil), "kythe.proto.KzipInfo.CorpusInfo")
 	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo_CompilationUnits)(nil), "kythe.proto.KzipInfo.CorpusInfo.LanguageCompilationUnitsEntry")
+	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo_RequiredInputs)(nil), "kythe.proto.KzipInfo.CorpusInfo.LanguageRequiredInputsEntry")
 	proto.RegisterType((*KzipInfo_CorpusInfo_CompilationUnits)(nil), "kythe.proto.KzipInfo.CorpusInfo.CompilationUnits")
+	proto.RegisterType((*KzipInfo_CorpusInfo_RequiredInputs)(nil), "kythe.proto.KzipInfo.CorpusInfo.RequiredInputs")
 	proto.RegisterType((*FilesRequest)(nil), "kythe.proto.FilesRequest")
 	proto.RegisterType((*FileInfo)(nil), "kythe.proto.FileInfo")
 	proto.RegisterType((*FileData)(nil), "kythe.proto.FileData")
@@ -851,70 +900,73 @@ func init() {
 func init() { proto.RegisterFile("kythe/proto/analysis.proto", fileDescriptor_8e4ea7eca60afe48) }
 
 var fileDescriptor_8e4ea7eca60afe48 = []byte{
-	// 1029 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0x1b, 0x45,
-	0x18, 0x66, 0xfd, 0xb9, 0x7e, 0xed, 0x26, 0xce, 0x50, 0xd0, 0x76, 0x69, 0x55, 0x6b, 0x51, 0xa1,
-	0xa5, 0x68, 0x03, 0x41, 0x2a, 0xa8, 0x41, 0x91, 0xf2, 0x61, 0x90, 0xd3, 0x34, 0x85, 0x49, 0xdb,
-	0x03, 0x42, 0x5a, 0x4d, 0xbc, 0x63, 0x67, 0x94, 0xf5, 0x8c, 0xbb, 0x33, 0x6b, 0x6a, 0x84, 0xb8,
-	0xf0, 0x23, 0xf8, 0x01, 0xdc, 0x10, 0x47, 0x0e, 0xfc, 0x34, 0x8e, 0x68, 0x66, 0x76, 0xed, 0x75,
-	0x20, 0x69, 0xcb, 0xc9, 0xfb, 0xbc, 0x9f, 0xb3, 0xef, 0xf3, 0xbc, 0xb3, 0x06, 0xff, 0x7c, 0xae,
-	0xce, 0xe8, 0xe6, 0x34, 0x15, 0x4a, 0x6c, 0x12, 0x4e, 0x92, 0xb9, 0x64, 0x32, 0x34, 0x10, 0xb5,
-	0x8d, 0xcf, 0x02, 0xff, 0xc6, 0x58, 0x88, 0x71, 0x92, 0x47, 0x9e, 0x66, 0xa3, 0x4d, 0xc2, 0xe7,
-	0x85, 0xab, 0x5c, 0x43, 0x2a, 0x91, 0x92, 0x71, 0x9e, 0x15, 0xfc, 0xe9, 0xc0, 0xfa, 0x6e, 0x5e,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x9f, 0xd1, 0xbb, 0xd0, 0x88, 0xd9, 0x98, 0x4a, 0x95, 0x8b, 0x36, 0x47, 0x01, 0xb3, 0x79,
-	0xfa, 0xb3, 0xa5, 0x99, 0x33, 0xf7, 0x43, 0xce, 0x68, 0x07, 0x17, 0xf0, 0x4d, 0xb6, 0xcd, 0x83,
-	0xe6, 0x84, 0x49, 0xc9, 0xf8, 0xd8, 0x90, 0xeb, 0xe2, 0x02, 0x06, 0x29, 0x6c, 0x94, 0x86, 0xbe,
-	0x97, 0xf1, 0x38, 0xa1, 0xe8, 0x13, 0xa8, 0x69, 0x01, 0xbf, 0xd6, 0x87, 0xd8, 0x44, 0x2e, 0xc7,
-	0x52, 0xb9, 0x64, 0x2c, 0xfa, 0x5d, 0x8a, 0xb1, 0xfc, 0xee, 0x00, 0x1a, 0xf0, 0x98, 0xbe, 0xa4,
-	0x71, 0xa9, 0xda, 0xff, 0xe8, 0xba, 0x0d, 0x75, 0xa6, 0xeb, 0xe4, 0x23, 0xb8, 0xb3, 0x92, 0xf2,
-	0xef, 0x0e, 0xd6, 0x84, 0x6d, 0x8e, 0x7f, 0x07, 0xea, 0x06, 0xa3, 0x9b, 0xd0, 0x2a, 0xfe, 0x01,
-	0x58, 0x5a, 0x5b, 0x78, 0x69, 0xd8, 0xfb, 0x1c, 0x6e, 0x0f, 0xc5, 0xa4, 0xb8, 0x9c, 0x62, 0x3a,
-	0x53, 0x42, 0x24, 0xb2, 0xdc, 0xe9, 0xbb, 0x8d, 0xe2, 0x5f, 0x52, 0x34, 0x16, 0x91, 0x31, 0xfd,
-	0xed, 0x38, 0xa7, 0x0d, 0xf3, 0xf4, 0xd9, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x06, 0x68,
-	0xbc, 0x50, 0x09, 0x00, 0x00,
+	// 1079 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x5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a3, 0x1b, 0x50, 0x09, 0xe9, 0x98, 0x48, 0x95, 0x2c, 0x74, 0x82, 0xba, 0xd4,
+	0xfa, 0xe9, 0xbf, 0x74, 0x3d, 0x5d, 0xe6, 0xed, 0x4c, 0x5a, 0xd1, 0xf4, 0x53, 0xf8, 0x21, 0x2f,
+	0x91, 0x0b, 0xd5, 0x09, 0x95, 0x92, 0xb2, 0xb1, 0x19, 0xc0, 0x9a, 0x9f, 0xc2, 0xae, 0x80, 0xd5,
+	0xcc, 0x60, 0x6c, 0xc7, 0x2c, 0x8c, 0x08, 0xfa, 0x1c, 0x4a, 0x7a, 0xb9, 0xaf, 0xf4, 0x91, 0x62,
+	0x2c, 0x97, 0x65, 0x29, 0x9c, 0x53, 0x16, 0x7d, 0x97, 0xb4, 0x2c, 0x7f, 0x38, 0x80, 0x06, 0x2c,
+	0x24, 0x6f, 0x49, 0x98, 0x89, 0xf6, 0x1f, 0x58, 0x37, 0xa0, 0x4c, 0x75, 0x9c, 0xa4, 0x04, 0xf7,
+	0x72, 0x2e, 0xef, 0x33, 0x58, 0x91, 0x6f, 0x7d, 0xbc, 0x7b, 0x50, 0x36, 0x18, 0xdd, 0x86, 0x7a,
+	0xfa, 0x75, 0x64, 0xdb, 0x5a, 0xf7, 0x97, 0x82, 0xed, 0xaf, 0xe0, 0xee, 0x90, 0x4f, 0xd2, 0x87,
+	0x3b, 0x24, 0x33, 0xc5, 0x79, 0x24, 0xb3, 0x4c, 0x3f, 0xac, 0xa6, 0x5f, 0x90, 0xc1, 0x98, 0x07,
+	0x46, 0xf4, 0x8f, 0xe3, 0x1c, 0x55, 0xcc, 0xe9, 0xcb, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1d,
+	0x66, 0x59, 0xe8, 0x6c, 0x0a, 0x00, 0x00,
 }


Test patch:
diff --git a/kythe/go/platform/kzip/info/info_test.go b/kythe/go/platform/kzip/info/info_test.go
index cef1a3ba0..9ea4a7cd9 100644
--- a/kythe/go/platform/kzip/info/info_test.go
+++ b/kythe/go/platform/kzip/info/info_test.go
@@ -36,6 +36,11 @@ func TestMergeKzipInfo(t *testing.T) {
 							RequiredInputs: 2,
 						},
 					},
+					LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+						"python": {
+							Count: 2,
+						},
+					},
 				},
 			},
 		},
@@ -54,6 +59,11 @@ func TestMergeKzipInfo(t *testing.T) {
 							RequiredInputs: 2,
 						},
 					},
+					LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+						"python": {
+							Count: 1,
+						},
+					},
 				},
 				"corpus2": {
 					LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
@@ -69,6 +79,19 @@ func TestMergeKzipInfo(t *testing.T) {
 						},
 					},
 				},
+				"unnamed_required_input_corpus": {
+					LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+						"python": {
+							Count: 9,
+						},
+						"java": {
+							Count: 20,
+						},
+						"go": {
+							Count: 2,
+						},
+					},
+				},
 			},
 		},
 	}
@@ -88,6 +111,11 @@ func TestMergeKzipInfo(t *testing.T) {
 						RequiredInputs: 2,
 					},
 				},
+				LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+					"python": {
+						Count: 3,
+					},
+				},
 			},
 			"corpus2": {
 				LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
@@ -103,6 +131,19 @@ func TestMergeKzipInfo(t *testing.T) {
 					},
 				},
 			},
+			"unnamed_required_input_corpus": {
+				LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+					"python": {
+						Count: 9,
+					},
+					"java": {
+						Count: 20,
+					},
+					"go": {
+						Count: 2,
+					},
+				},
+			},
 		},
 	}
 	wantTotal := apb.KzipInfo_CorpusInfo{
@@ -123,6 +164,17 @@ func TestMergeKzipInfo(t *testing.T) {
 				RequiredInputs: 20,
 			},
 		},
+		LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+			"python": {
+				Count: 12,
+			},
+			"java": {
+				Count: 20,
+			},
+			"go": {
+				Count: 2,
+			},
+		},
 	}
 
 	got := MergeKzipInfo(infos)